@descope/nextjs-sdk 0.2.12 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -0
- package/dist/client/dts/src/shared/DescopeWidgets.d.ts +14 -0
- package/dist/dts/src/shared/DescopeWidgets.d.ts +14 -0
- package/dist/index.d.ts +15 -1
- package/dist/index.js +1 -1
- package/dist/server/constants.js +1 -1
- package/dist/server/constants.js.map +1 -1
- package/dist/server/dts/src/shared/DescopeWidgets.d.ts +14 -0
- package/dist/shared/DescopeWidgets.js +3 -2
- package/dist/shared/DescopeWidgets.js.map +1 -1
- package/dist/shared/constants.js +1 -1
- package/dist/shared/constants.js.map +1 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -422,6 +422,23 @@ import { UserProfile } from '@descope/nextjs-sdk';
|
|
|
422
422
|
Example:
|
|
423
423
|
[User Profile](./examples/app-router/app/my-user-profile/page.tsx)
|
|
424
424
|
|
|
425
|
+
#### Applications Portal
|
|
426
|
+
|
|
427
|
+
The `ApplicationsPortal` lets you embed an applications portal component in your app and allows the logged-in user to open applications they are assigned to.
|
|
428
|
+
|
|
429
|
+
###### Usage
|
|
430
|
+
|
|
431
|
+
```js
|
|
432
|
+
import { ApplicationsPortal } from '@descope/nextjs-sdk';
|
|
433
|
+
...
|
|
434
|
+
<ApplicationsPortal
|
|
435
|
+
widgetId="applications-portal-widget"
|
|
436
|
+
/>
|
|
437
|
+
```
|
|
438
|
+
|
|
439
|
+
Example:
|
|
440
|
+
[User Profile](./examples/app-router/app/my-applications-portal/page.tsx)
|
|
441
|
+
|
|
425
442
|
## Code Example
|
|
426
443
|
|
|
427
444
|
You can find an example react app in the [examples folder](./examples). - [App Router](/examples/app-router/) - [Pages Router](/examples/pages-router/)
|
|
@@ -62,3 +62,17 @@ export declare const UserProfile: _1.ComponentType<Omit<{
|
|
|
62
62
|
}, "tenant"> & {
|
|
63
63
|
onLogout?: (e: CustomEvent<any>) => void;
|
|
64
64
|
} & _1.RefAttributes<HTMLElement>>;
|
|
65
|
+
export declare const ApplicationsPortal: _1.ComponentType<Omit<{
|
|
66
|
+
logger?: Partial<{
|
|
67
|
+
error(...data: any[]): void;
|
|
68
|
+
warn(...data: any[]): void;
|
|
69
|
+
info(...data: any[]): void;
|
|
70
|
+
debug(...data: any[]): void;
|
|
71
|
+
}>;
|
|
72
|
+
tenant: string;
|
|
73
|
+
widgetId: string;
|
|
74
|
+
theme?: import("@descope/web-component").ThemeOptions;
|
|
75
|
+
debug?: boolean;
|
|
76
|
+
}, "tenant"> & {
|
|
77
|
+
onLogout?: (e: CustomEvent<any>) => void;
|
|
78
|
+
} & _1.RefAttributes<HTMLElement>>;
|
|
@@ -62,3 +62,17 @@ export declare const UserProfile: _1.ComponentType<Omit<{
|
|
|
62
62
|
}, "tenant"> & {
|
|
63
63
|
onLogout?: (e: CustomEvent<any>) => void;
|
|
64
64
|
} & _1.RefAttributes<HTMLElement>>;
|
|
65
|
+
export declare const ApplicationsPortal: _1.ComponentType<Omit<{
|
|
66
|
+
logger?: Partial<{
|
|
67
|
+
error(...data: any[]): void;
|
|
68
|
+
warn(...data: any[]): void;
|
|
69
|
+
info(...data: any[]): void;
|
|
70
|
+
debug(...data: any[]): void;
|
|
71
|
+
}>;
|
|
72
|
+
tenant: string;
|
|
73
|
+
widgetId: string;
|
|
74
|
+
theme?: import("@descope/web-component").ThemeOptions;
|
|
75
|
+
debug?: boolean;
|
|
76
|
+
}, "tenant"> & {
|
|
77
|
+
onLogout?: (e: CustomEvent<any>) => void;
|
|
78
|
+
} & _1.RefAttributes<HTMLElement>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -199,5 +199,19 @@ declare const UserProfile: _1.ComponentType<Omit<{
|
|
|
199
199
|
}, "tenant"> & {
|
|
200
200
|
onLogout?: (e: CustomEvent<any>) => void;
|
|
201
201
|
} & _1.RefAttributes<HTMLElement>>;
|
|
202
|
+
declare const ApplicationsPortal: _1.ComponentType<Omit<{
|
|
203
|
+
logger?: Partial<{
|
|
204
|
+
error(...data: any[]): void;
|
|
205
|
+
warn(...data: any[]): void;
|
|
206
|
+
info(...data: any[]): void;
|
|
207
|
+
debug(...data: any[]): void;
|
|
208
|
+
}>;
|
|
209
|
+
tenant: string;
|
|
210
|
+
widgetId: string;
|
|
211
|
+
theme?: _descope_web_component.ThemeOptions;
|
|
212
|
+
debug?: boolean;
|
|
213
|
+
}, "tenant"> & {
|
|
214
|
+
onLogout?: (e: CustomEvent<any>) => void;
|
|
215
|
+
} & _1.RefAttributes<HTMLElement>>;
|
|
202
216
|
|
|
203
|
-
export { AccessKeyManagement, AuditManagement, AuthProvider, Descope, RoleManagement, SignInFlow, SignUpFlow, SignUpOrInFlow, UserManagement, UserProfile };
|
|
217
|
+
export { AccessKeyManagement, ApplicationsPortal, AuditManagement, AuthProvider, Descope, RoleManagement, SignInFlow, SignUpFlow, SignUpOrInFlow, UserManagement, UserProfile };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as AuthProvider } from './shared/AuthProvider.js';
|
|
2
2
|
export { Descope, SignInFlow, SignUpFlow, SignUpOrInFlow } from './shared/DescopeFlows.js';
|
|
3
|
-
export { AccessKeyManagement, AuditManagement, RoleManagement, UserManagement, UserProfile } from './shared/DescopeWidgets.js';
|
|
3
|
+
export { AccessKeyManagement, ApplicationsPortal, AuditManagement, RoleManagement, UserManagement, UserProfile } from './shared/DescopeWidgets.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
package/dist/server/constants.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const DESCOPE_SESSION_HEADER = 'x-descope-session';
|
|
2
2
|
const baseHeaders = {
|
|
3
3
|
'x-descope-sdk-name': 'nextjs',
|
|
4
|
-
'x-descope-sdk-version': "0.
|
|
4
|
+
'x-descope-sdk-version': "0.3.0"
|
|
5
5
|
};
|
|
6
6
|
const DEFAULT_PUBLIC_ROUTES = {
|
|
7
7
|
signIn: process.env.SIGN_IN_ROUTE || '/sign-in',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/server/constants.ts"],"sourcesContent":["// Replaced in build time\ndeclare const BUILD_VERSION: string;\n\nexport const DESCOPE_SESSION_HEADER = 'x-descope-session';\n\nexport const baseHeaders = {\n\t'x-descope-sdk-name': 'nextjs',\n\t'x-descope-sdk-version': BUILD_VERSION\n};\n\nexport const DEFAULT_PUBLIC_ROUTES = {\n\tsignIn: process.env.SIGN_IN_ROUTE || '/sign-in',\n\tsignUp: process.env.SIGN_UP_ROUTE || '/sign-up'\n};\n"],"names":[],"mappings":"AAGO,MAAM,sBAAsB,GAAG,oBAAoB;AAE7C,MAAA,WAAW,GAAG;AAC1B,IAAA,oBAAoB,EAAE,QAAQ;AAC9B,IAAA,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/server/constants.ts"],"sourcesContent":["// Replaced in build time\ndeclare const BUILD_VERSION: string;\n\nexport const DESCOPE_SESSION_HEADER = 'x-descope-session';\n\nexport const baseHeaders = {\n\t'x-descope-sdk-name': 'nextjs',\n\t'x-descope-sdk-version': BUILD_VERSION\n};\n\nexport const DEFAULT_PUBLIC_ROUTES = {\n\tsignIn: process.env.SIGN_IN_ROUTE || '/sign-in',\n\tsignUp: process.env.SIGN_UP_ROUTE || '/sign-up'\n};\n"],"names":[],"mappings":"AAGO,MAAM,sBAAsB,GAAG,oBAAoB;AAE7C,MAAA,WAAW,GAAG;AAC1B,IAAA,oBAAoB,EAAE,QAAQ;AAC9B,IAAA,uBAAuB,EAAE,OAAa;EACrC;AAEW,MAAA,qBAAqB,GAAG;AACpC,IAAA,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,UAAU;AAC/C,IAAA,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,UAAU;;;;;"}
|
|
@@ -62,3 +62,17 @@ export declare const UserProfile: _1.ComponentType<Omit<{
|
|
|
62
62
|
}, "tenant"> & {
|
|
63
63
|
onLogout?: (e: CustomEvent<any>) => void;
|
|
64
64
|
} & _1.RefAttributes<HTMLElement>>;
|
|
65
|
+
export declare const ApplicationsPortal: _1.ComponentType<Omit<{
|
|
66
|
+
logger?: Partial<{
|
|
67
|
+
error(...data: any[]): void;
|
|
68
|
+
warn(...data: any[]): void;
|
|
69
|
+
info(...data: any[]): void;
|
|
70
|
+
debug(...data: any[]): void;
|
|
71
|
+
}>;
|
|
72
|
+
tenant: string;
|
|
73
|
+
widgetId: string;
|
|
74
|
+
theme?: import("@descope/web-component").ThemeOptions;
|
|
75
|
+
debug?: boolean;
|
|
76
|
+
}, "tenant"> & {
|
|
77
|
+
onLogout?: (e: CustomEvent<any>) => void;
|
|
78
|
+
} & _1.RefAttributes<HTMLElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import dynamic from 'next/dynamic';
|
|
3
|
-
import { UserManagement as UserManagement$1, RoleManagement as RoleManagement$1, AccessKeyManagement as AccessKeyManagement$1, AuditManagement as AuditManagement$1, UserProfile as UserProfile$1 } from '@descope/react-sdk';
|
|
3
|
+
import { UserManagement as UserManagement$1, RoleManagement as RoleManagement$1, AccessKeyManagement as AccessKeyManagement$1, AuditManagement as AuditManagement$1, UserProfile as UserProfile$1, ApplicationsPortal as ApplicationsPortal$1 } from '@descope/react-sdk';
|
|
4
4
|
|
|
5
5
|
// a helper function to dynamically load the components
|
|
6
6
|
// This function prevents Next.js from trying to server-side render these components
|
|
@@ -14,6 +14,7 @@ const RoleManagement = dynamicWidgetComponent(RoleManagement$1);
|
|
|
14
14
|
const AccessKeyManagement = dynamicWidgetComponent(AccessKeyManagement$1);
|
|
15
15
|
const AuditManagement = dynamicWidgetComponent(AuditManagement$1);
|
|
16
16
|
const UserProfile = dynamicWidgetComponent(UserProfile$1);
|
|
17
|
+
const ApplicationsPortal = dynamicWidgetComponent(ApplicationsPortal$1);
|
|
17
18
|
|
|
18
|
-
export { AccessKeyManagement, AuditManagement, RoleManagement, UserManagement, UserProfile };
|
|
19
|
+
export { AccessKeyManagement, ApplicationsPortal, AuditManagement, RoleManagement, UserManagement, UserProfile };
|
|
19
20
|
//# sourceMappingURL=DescopeWidgets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DescopeWidgets.js","sources":["../../src/shared/DescopeWidgets.tsx"],"sourcesContent":["'use client';\n\n// eslint-disable-next-line\nimport type * as _1 from '@descope/react-sdk/node_modules/@types/react';\n\nimport { ComponentType } from 'react';\nimport dynamic from 'next/dynamic';\nimport {\n\tUserManagement as UserManagementWC,\n\tRoleManagement as RoleManagementWC,\n\tAccessKeyManagement as AccessKeyManagementWC,\n\tAuditManagement as AuditManagementWC,\n\tUserProfile as UserProfileWc\n} from '@descope/react-sdk';\n\n// a helper function to dynamically load the components\n// This function prevents Next.js from trying to server-side render these components\n// Update the helper function to use generics for preserving component prop types\nconst dynamicWidgetComponent = <P extends {}>(Component: ComponentType<P>) =>\n\tdynamic<P>(() => Promise.resolve(Component), {\n\t\tssr: false // Disable server-side rendering for this component\n\t});\n\n// Use the helper function to create dynamically loaded components\nexport const UserManagement = dynamicWidgetComponent(UserManagementWC);\nexport const RoleManagement = dynamicWidgetComponent(RoleManagementWC);\nexport const AccessKeyManagement = dynamicWidgetComponent(\n\tAccessKeyManagementWC\n);\nexport const AuditManagement = dynamicWidgetComponent(AuditManagementWC);\nexport const UserProfile = dynamicWidgetComponent(UserProfileWc);\n"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"DescopeWidgets.js","sources":["../../src/shared/DescopeWidgets.tsx"],"sourcesContent":["'use client';\n\n// eslint-disable-next-line\nimport type * as _1 from '@descope/react-sdk/node_modules/@types/react';\n\nimport { ComponentType } from 'react';\nimport dynamic from 'next/dynamic';\nimport {\n\tUserManagement as UserManagementWC,\n\tRoleManagement as RoleManagementWC,\n\tAccessKeyManagement as AccessKeyManagementWC,\n\tAuditManagement as AuditManagementWC,\n\tUserProfile as UserProfileWc,\n\tApplicationsPortal as ApplicationsPortalWc\n} from '@descope/react-sdk';\n\n// a helper function to dynamically load the components\n// This function prevents Next.js from trying to server-side render these components\n// Update the helper function to use generics for preserving component prop types\nconst dynamicWidgetComponent = <P extends {}>(Component: ComponentType<P>) =>\n\tdynamic<P>(() => Promise.resolve(Component), {\n\t\tssr: false // Disable server-side rendering for this component\n\t});\n\n// Use the helper function to create dynamically loaded components\nexport const UserManagement = dynamicWidgetComponent(UserManagementWC);\nexport const RoleManagement = dynamicWidgetComponent(RoleManagementWC);\nexport const AccessKeyManagement = dynamicWidgetComponent(\n\tAccessKeyManagementWC\n);\nexport const AuditManagement = dynamicWidgetComponent(AuditManagementWC);\nexport const UserProfile = dynamicWidgetComponent(UserProfileWc);\nexport const ApplicationsPortal = dynamicWidgetComponent(ApplicationsPortalWc);\n"],"names":[],"mappings":";;;;AAgBA;AACA;AACA;AACA;;AAGE;AAEF;;;;;;;;"}
|
package/dist/shared/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../../src/shared/constants.ts"],"sourcesContent":["// Replaced in build time\ndeclare const BUILD_VERSION: string;\n\n// eslint-disable-next-line import/prefer-default-export\nexport const baseHeaders = {\n\t'x-descope-sdk-name': 'nextjs',\n\t'x-descope-sdk-version': BUILD_VERSION\n};\n"],"names":[],"mappings":"AAGA;AACa,MAAA,WAAW,GAAG;AAC1B,IAAA,oBAAoB,EAAE,QAAQ;AAC9B,IAAA,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../../src/shared/constants.ts"],"sourcesContent":["// Replaced in build time\ndeclare const BUILD_VERSION: string;\n\n// eslint-disable-next-line import/prefer-default-export\nexport const baseHeaders = {\n\t'x-descope-sdk-name': 'nextjs',\n\t'x-descope-sdk-version': BUILD_VERSION\n};\n"],"names":[],"mappings":"AAGA;AACa,MAAA,WAAW,GAAG;AAC1B,IAAA,oBAAoB,EAAE,QAAQ;AAC9B,IAAA,uBAAuB,EAAE,OAAa;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@descope/nextjs-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Descope NextJS SDK",
|
|
5
5
|
"author": "Descope Team <info@descope.com>",
|
|
6
6
|
"homepage": "https://github.com/descope/descope-js",
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"@descope/node-sdk": "1.6.9",
|
|
64
|
-
"@descope/
|
|
65
|
-
"@descope/
|
|
66
|
-
"@descope/
|
|
64
|
+
"@descope/react-sdk": "2.1.0",
|
|
65
|
+
"@descope/core-js-sdk": "2.27.0",
|
|
66
|
+
"@descope/web-component": "3.26.0"
|
|
67
67
|
},
|
|
68
68
|
"devDependencies": {
|
|
69
69
|
"@babel/core": "7.23.9",
|