diff --git a/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx b/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx
index 5867df4ace..f33c9a7282 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenDocs/ApiTokenDocs.tsx
@@ -9,15 +9,15 @@ export const ApiTokenDocs = () => {
Read the{' '}
- Getting started guide
+ SDK overview
{' '}
- to learn how to connect to the Unleash API from your application
- or programmatically. Please note it can take up to 1 minute
- before a new API key is activated.
+ to connect Unleash to your application. Please note it can take
+ up to 1 minute before a new API key is
+ activated.
API URL: {' '}
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.styles.ts b/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.styles.ts
index 7677b5a830..e54129a369 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.styles.ts
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.styles.ts
@@ -17,6 +17,15 @@ export const useStyles = makeStyles()(theme => ({
minWidth: '379px',
},
},
+ radioGroup: {
+ marginBottom: theme.spacing(2),
+ },
+ radioItem: {
+ marginBottom: theme.spacing(1),
+ },
+ radio: {
+ marginLeft: theme.spacing(1.5),
+ },
label: {
minWidth: '300px',
[theme.breakpoints.down(600)]: {
diff --git a/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx b/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx
index ac28e641fb..52b5c152ce 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenForm/ApiTokenForm.tsx
@@ -1,13 +1,22 @@
-import { Button } from '@mui/material';
+import {
+ Button,
+ FormControl,
+ FormControlLabel,
+ Radio,
+ RadioGroup,
+ Typography,
+} from '@mui/material';
import { KeyboardArrowDownOutlined } from '@mui/icons-material';
import React from 'react';
import { useEnvironments } from 'hooks/api/getters/useEnvironments/useEnvironments';
import useProjects from 'hooks/api/getters/useProjects/useProjects';
import GeneralSelect from 'component/common/GeneralSelect/GeneralSelect';
import Input from 'component/common/Input/Input';
-import { useStyles } from './ApiTokenForm.styles';
+import useUiConfig from 'hooks/api/getters/useUiConfig/useUiConfig';
import { SelectProjectInput } from './SelectProjectInput/SelectProjectInput';
-import { ApiTokenFormErrorType } from 'component/admin/apiToken/ApiTokenForm/useApiTokenForm';
+import { ApiTokenFormErrorType } from './useApiTokenForm';
+import { useStyles } from './ApiTokenForm.styles';
+
interface IApiTokenFormProps {
username: string;
type: string;
@@ -40,15 +49,32 @@ const ApiTokenForm: React.FC = ({
clearErrors,
}) => {
const TYPE_ADMIN = 'ADMIN';
+ const { uiConfig } = useUiConfig();
const { classes: styles } = useStyles();
const { environments } = useEnvironments();
const { projects: availableProjects } = useProjects();
const selectableTypes = [
- { key: 'CLIENT', label: 'Client', title: 'Client SDK token' },
- { key: 'ADMIN', label: 'Admin', title: 'Admin API token' },
+ {
+ key: 'CLIENT',
+ label: 'Server-side SDK (CLIENT)',
+ title: 'Connect server-side SDK or Unleash Proxy',
+ },
+ {
+ key: 'ADMIN',
+ label: 'ADMIN',
+ title: 'Full access for managing Unleash',
+ },
];
+ if (uiConfig.embedProxy) {
+ selectableTypes.splice(1, 0, {
+ key: 'FRONTEND',
+ label: 'Client-side SDK (FRONTEND)',
+ title: 'Connect web and mobile SDK directly to Unleash',
+ });
+ }
+
const selectableProjects = availableProjects.map(project => ({
value: project.id,
label: project.name,
@@ -81,20 +107,38 @@ const ApiTokenForm: React.FC = ({
onFocus={() => clearErrors('username')}
autoFocus
/>
-
- What is your token type?
-
-
+
+
+ What do you want to connect?
+
+ setTokenType(value)}
+ >
+ {selectableTypes.map(({ key, label, title }) => (
+ }
+ label={
+ <>
+ {label}
+
+ {title}
+
+ >
+ }
+ />
+ ))}
+
+
Which project do you want to give access to?
diff --git a/frontend/src/component/admin/apiToken/ApiTokenTable/ApiTokenTable.tsx b/frontend/src/component/admin/apiToken/ApiTokenTable/ApiTokenTable.tsx
index 7c80940907..811b3316c8 100644
--- a/frontend/src/component/admin/apiToken/ApiTokenTable/ApiTokenTable.tsx
+++ b/frontend/src/component/admin/apiToken/ApiTokenTable/ApiTokenTable.tsx
@@ -78,9 +78,14 @@ export const ApiTokenTable = () => {
/>
}
>
-
-
-
+ 0}
+ show={
+
+
+
+ }
+ />
@@ -118,7 +123,17 @@ export const ApiTokenTable = () => {
}
elseShow={
- No tokens available. Get started by adding one.
+
+ {'No tokens available. Read '}
+
+ API How-to guides
+ {' '}
+ {' to learn more.'}
+
}
/>
@@ -128,6 +143,21 @@ export const ApiTokenTable = () => {
);
};
+const tokenDescriptions = {
+ client: {
+ label: 'CLIENT',
+ title: 'Connect server-side SDK or Unleash Proxy',
+ },
+ frontend: {
+ label: 'FRONTEND',
+ title: 'Connect web and mobile SDK',
+ },
+ admin: {
+ label: 'ADMIN',
+ title: 'Full access for managing Unleash',
+ },
+};
+
const COLUMNS = [
{
id: 'Icon',
@@ -144,10 +174,13 @@ const COLUMNS = [
{
Header: 'Type',
accessor: 'type',
- Cell: ({ value }: { value: string }) => (
-
+ Cell: ({ value }: { value: 'admin' | 'client' | 'frontend' }) => (
+
),
- minWidth: 100,
+ minWidth: 280,
},
{
Header: 'Project',
diff --git a/frontend/src/interfaces/uiConfig.ts b/frontend/src/interfaces/uiConfig.ts
index 83dc4ad0ad..1a0e65563b 100644
--- a/frontend/src/interfaces/uiConfig.ts
+++ b/frontend/src/interfaces/uiConfig.ts
@@ -16,6 +16,7 @@ export interface IUiConfig {
toast?: IProclamationToast;
segmentValuesLimit?: number;
strategySegmentsLimit?: number;
+ embedProxy?: boolean;
}
export interface IProclamationToast {