Skip to content

Commit 3677078

Browse files
fixing
1 parent 5522371 commit 3677078

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

fern/customization/jwt-authentication.mdx

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,10 @@ For example, it can be used to restrict which API endpoints the token can access
3939
// Define the payload
4040
const payload = {
4141
orgId: process.env.ORG_ID,
42-
// This is the scope of the token
43-
tag: 'private',
42+
token: {
43+
// This is the scope of the token
44+
tag: 'private',
45+
},
4446
};
4547

4648
// Get the private key from environment variables
@@ -61,13 +63,15 @@ const token = generateJWT(payload, key, options);
6163
// Define the payload
6264
const payload = {
6365
orgId: process.env.ORG_ID,
64-
// This is the scope of the token
65-
tag: 'public',
66-
restrictions: {
67-
enabled: true,
68-
allowedOrigins: ['https://example.vapi.ai'],
69-
allowedAssistantIds: ['1cbf8c70-5fd7-4f61-a220-376ab35be1b0'],
70-
allowTransientAssistant: false,
66+
token: {
67+
// This is the scope of the token
68+
tag: 'public',
69+
restrictions: {
70+
enabled: true,
71+
allowedOrigins: ['https://example.vapi.ai'],
72+
allowedAssistantIds: ['1cbf8c70-5fd7-4f61-a220-376ab35be1b0'],
73+
allowTransientAssistant: false,
74+
},
7175
},
7276
};
7377

0 commit comments

Comments
 (0)