@descope/nextjs-sdk 0.3.14 → 0.3.15

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.
@@ -1,39 +1,11 @@
1
- /// <reference types="react" />
2
- import type * as _1 from '@descope/react-sdk/node_modules/@types/react';
3
1
  import type * as _2 from '@descope/react-sdk/node_modules/@descope/web-component/dist';
2
+ import React from 'react';
4
3
  type AdditionalProps = {
5
4
  redirectAfterSuccess?: string;
6
5
  redirectAfterError?: string;
7
6
  };
8
- export declare const Descope: _1.ComponentType<{
9
- flowId: string;
10
- onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
11
- onError?: (e: CustomEvent<{
12
- errorCode: string;
13
- errorDescription: string;
14
- errorMessage?: string;
15
- retryAfter?: string;
16
- }>) => void;
17
- onReady?: (e: CustomEvent<{}>) => void;
18
- logger?: _descope_sdk_mixins_themeMixin.Logger;
19
- tenant?: string;
20
- theme?: _2.ThemeOptions;
21
- locale?: string;
22
- autoFocus?: _2.AutoFocusOptions;
23
- validateOnBlur?: boolean;
24
- restartOnError?: boolean;
25
- debug?: boolean;
26
- telemetryKey?: string;
27
- redirectUrl?: string;
28
- errorTransformer?: (error: {
29
- text: string;
30
- type: string;
31
- }) => string;
32
- form?: Record<string, any>;
33
- client?: Record<string, any>;
34
- styleId?: string;
35
- } & _1.RefAttributes<HTMLElement> & AdditionalProps>;
36
- export declare const SignInFlow: _1.ComponentType<{
7
+ export declare const Descope: React.ComponentType<AdditionalProps>;
8
+ export declare const SignInFlow: React.ComponentType<{
37
9
  form?: Record<string, any>;
38
10
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
39
11
  onError?: (e: CustomEvent<{
@@ -60,7 +32,7 @@ export declare const SignInFlow: _1.ComponentType<{
60
32
  client?: Record<string, any>;
61
33
  styleId?: string;
62
34
  } & AdditionalProps>;
63
- export declare const SignUpFlow: _1.ComponentType<{
35
+ export declare const SignUpFlow: React.ComponentType<{
64
36
  form?: Record<string, any>;
65
37
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
66
38
  onError?: (e: CustomEvent<{
@@ -87,7 +59,7 @@ export declare const SignUpFlow: _1.ComponentType<{
87
59
  client?: Record<string, any>;
88
60
  styleId?: string;
89
61
  } & AdditionalProps>;
90
- export declare const SignUpOrInFlow: _1.ComponentType<{
62
+ export declare const SignUpOrInFlow: React.ComponentType<{
91
63
  form?: Record<string, any>;
92
64
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
93
65
  onError?: (e: CustomEvent<{
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import type * as _1 from '@descope/react-sdk/node_modules/@types/react';
3
- export declare const UserManagement: _1.ComponentType<{
2
+ import { ComponentType } from 'react';
3
+ export declare const UserManagement: ComponentType<{
4
4
  logger?: _descope_sdk_mixins_themeMixin.Logger;
5
5
  tenant: string;
6
6
  widgetId: string;
@@ -8,7 +8,7 @@ export declare const UserManagement: _1.ComponentType<{
8
8
  debug?: boolean;
9
9
  styleId?: string;
10
10
  } & _1.RefAttributes<HTMLElement>>;
11
- export declare const RoleManagement: _1.ComponentType<{
11
+ export declare const RoleManagement: ComponentType<{
12
12
  logger?: _descope_sdk_mixins_themeMixin.Logger;
13
13
  tenant: string;
14
14
  widgetId: string;
@@ -16,7 +16,7 @@ export declare const RoleManagement: _1.ComponentType<{
16
16
  debug?: boolean;
17
17
  styleId?: string;
18
18
  } & _1.RefAttributes<HTMLElement>>;
19
- export declare const AccessKeyManagement: _1.ComponentType<{
19
+ export declare const AccessKeyManagement: ComponentType<{
20
20
  logger?: _descope_sdk_mixins_themeMixin.Logger;
21
21
  tenant: string;
22
22
  widgetId: string;
@@ -24,7 +24,7 @@ export declare const AccessKeyManagement: _1.ComponentType<{
24
24
  debug?: boolean;
25
25
  styleId?: string;
26
26
  } & _1.RefAttributes<HTMLElement>>;
27
- export declare const AuditManagement: _1.ComponentType<{
27
+ export declare const AuditManagement: ComponentType<{
28
28
  logger?: _descope_sdk_mixins_themeMixin.Logger;
29
29
  tenant: string;
30
30
  widgetId: string;
@@ -32,7 +32,7 @@ export declare const AuditManagement: _1.ComponentType<{
32
32
  debug?: boolean;
33
33
  styleId?: string;
34
34
  } & _1.RefAttributes<HTMLElement>>;
35
- export declare const UserProfile: _1.ComponentType<Omit<{
35
+ export declare const UserProfile: ComponentType<Omit<{
36
36
  logger?: _descope_sdk_mixins_themeMixin.Logger;
37
37
  tenant: string;
38
38
  widgetId: string;
@@ -42,7 +42,7 @@ export declare const UserProfile: _1.ComponentType<Omit<{
42
42
  }, "tenant"> & {
43
43
  onLogout?: (e: CustomEvent<any>) => void;
44
44
  } & _1.RefAttributes<HTMLElement>>;
45
- export declare const ApplicationsPortal: _1.ComponentType<Omit<{
45
+ export declare const ApplicationsPortal: ComponentType<Omit<{
46
46
  logger?: _descope_sdk_mixins_themeMixin.Logger;
47
47
  tenant: string;
48
48
  widgetId: string;
@@ -1,39 +1,11 @@
1
- /// <reference types="react" />
2
- import type * as _1 from '@descope/react-sdk/node_modules/@types/react';
3
1
  import type * as _2 from '@descope/react-sdk/node_modules/@descope/web-component/dist';
2
+ import React from 'react';
4
3
  type AdditionalProps = {
5
4
  redirectAfterSuccess?: string;
6
5
  redirectAfterError?: string;
7
6
  };
8
- export declare const Descope: _1.ComponentType<{
9
- flowId: string;
10
- onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
11
- onError?: (e: CustomEvent<{
12
- errorCode: string;
13
- errorDescription: string;
14
- errorMessage?: string;
15
- retryAfter?: string;
16
- }>) => void;
17
- onReady?: (e: CustomEvent<{}>) => void;
18
- logger?: _descope_sdk_mixins_themeMixin.Logger;
19
- tenant?: string;
20
- theme?: _2.ThemeOptions;
21
- locale?: string;
22
- autoFocus?: _2.AutoFocusOptions;
23
- validateOnBlur?: boolean;
24
- restartOnError?: boolean;
25
- debug?: boolean;
26
- telemetryKey?: string;
27
- redirectUrl?: string;
28
- errorTransformer?: (error: {
29
- text: string;
30
- type: string;
31
- }) => string;
32
- form?: Record<string, any>;
33
- client?: Record<string, any>;
34
- styleId?: string;
35
- } & _1.RefAttributes<HTMLElement> & AdditionalProps>;
36
- export declare const SignInFlow: _1.ComponentType<{
7
+ export declare const Descope: React.ComponentType<AdditionalProps>;
8
+ export declare const SignInFlow: React.ComponentType<{
37
9
  form?: Record<string, any>;
38
10
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
39
11
  onError?: (e: CustomEvent<{
@@ -60,7 +32,7 @@ export declare const SignInFlow: _1.ComponentType<{
60
32
  client?: Record<string, any>;
61
33
  styleId?: string;
62
34
  } & AdditionalProps>;
63
- export declare const SignUpFlow: _1.ComponentType<{
35
+ export declare const SignUpFlow: React.ComponentType<{
64
36
  form?: Record<string, any>;
65
37
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
66
38
  onError?: (e: CustomEvent<{
@@ -87,7 +59,7 @@ export declare const SignUpFlow: _1.ComponentType<{
87
59
  client?: Record<string, any>;
88
60
  styleId?: string;
89
61
  } & AdditionalProps>;
90
- export declare const SignUpOrInFlow: _1.ComponentType<{
62
+ export declare const SignUpOrInFlow: React.ComponentType<{
91
63
  form?: Record<string, any>;
92
64
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
93
65
  onError?: (e: CustomEvent<{
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import type * as _1 from '@descope/react-sdk/node_modules/@types/react';
3
- export declare const UserManagement: _1.ComponentType<{
2
+ import { ComponentType } from 'react';
3
+ export declare const UserManagement: ComponentType<{
4
4
  logger?: _descope_sdk_mixins_themeMixin.Logger;
5
5
  tenant: string;
6
6
  widgetId: string;
@@ -8,7 +8,7 @@ export declare const UserManagement: _1.ComponentType<{
8
8
  debug?: boolean;
9
9
  styleId?: string;
10
10
  } & _1.RefAttributes<HTMLElement>>;
11
- export declare const RoleManagement: _1.ComponentType<{
11
+ export declare const RoleManagement: ComponentType<{
12
12
  logger?: _descope_sdk_mixins_themeMixin.Logger;
13
13
  tenant: string;
14
14
  widgetId: string;
@@ -16,7 +16,7 @@ export declare const RoleManagement: _1.ComponentType<{
16
16
  debug?: boolean;
17
17
  styleId?: string;
18
18
  } & _1.RefAttributes<HTMLElement>>;
19
- export declare const AccessKeyManagement: _1.ComponentType<{
19
+ export declare const AccessKeyManagement: ComponentType<{
20
20
  logger?: _descope_sdk_mixins_themeMixin.Logger;
21
21
  tenant: string;
22
22
  widgetId: string;
@@ -24,7 +24,7 @@ export declare const AccessKeyManagement: _1.ComponentType<{
24
24
  debug?: boolean;
25
25
  styleId?: string;
26
26
  } & _1.RefAttributes<HTMLElement>>;
27
- export declare const AuditManagement: _1.ComponentType<{
27
+ export declare const AuditManagement: ComponentType<{
28
28
  logger?: _descope_sdk_mixins_themeMixin.Logger;
29
29
  tenant: string;
30
30
  widgetId: string;
@@ -32,7 +32,7 @@ export declare const AuditManagement: _1.ComponentType<{
32
32
  debug?: boolean;
33
33
  styleId?: string;
34
34
  } & _1.RefAttributes<HTMLElement>>;
35
- export declare const UserProfile: _1.ComponentType<Omit<{
35
+ export declare const UserProfile: ComponentType<Omit<{
36
36
  logger?: _descope_sdk_mixins_themeMixin.Logger;
37
37
  tenant: string;
38
38
  widgetId: string;
@@ -42,7 +42,7 @@ export declare const UserProfile: _1.ComponentType<Omit<{
42
42
  }, "tenant"> & {
43
43
  onLogout?: (e: CustomEvent<any>) => void;
44
44
  } & _1.RefAttributes<HTMLElement>>;
45
- export declare const ApplicationsPortal: _1.ComponentType<Omit<{
45
+ export declare const ApplicationsPortal: ComponentType<Omit<{
46
46
  logger?: _descope_sdk_mixins_themeMixin.Logger;
47
47
  tenant: string;
48
48
  widgetId: string;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- /// <reference types="react" />
2
1
  import { AuthProvider as AuthProvider$1 } from '@descope/react-sdk';
3
2
  import * as _descope_core_js_sdk from '@descope/core-js-sdk';
4
- import * as _1 from '@descope/react-sdk/node_modules/@types/react';
5
3
  import * as _2 from '@descope/react-sdk/node_modules/@descope/web-component/dist';
4
+ import React, { ComponentType } from 'react';
6
5
  import * as _descope_web_component from '@descope/web-component';
6
+ import * as _1 from '@descope/react-sdk/node_modules/@types/react';
7
7
 
8
8
  declare const AuthProvider: typeof AuthProvider$1;
9
9
 
@@ -11,35 +11,8 @@ type AdditionalProps = {
11
11
  redirectAfterSuccess?: string;
12
12
  redirectAfterError?: string;
13
13
  };
14
- declare const Descope: _1.ComponentType<{
15
- flowId: string;
16
- onSuccess?: (e: CustomEvent<_descope_core_js_sdk.JWTResponse>) => void;
17
- onError?: (e: CustomEvent<{
18
- errorCode: string;
19
- errorDescription: string;
20
- errorMessage?: string;
21
- retryAfter?: string;
22
- }>) => void;
23
- onReady?: (e: CustomEvent<{}>) => void;
24
- logger?: _descope_sdk_mixins_themeMixin.Logger;
25
- tenant?: string;
26
- theme?: _2.ThemeOptions;
27
- locale?: string;
28
- autoFocus?: _2.AutoFocusOptions;
29
- validateOnBlur?: boolean;
30
- restartOnError?: boolean;
31
- debug?: boolean;
32
- telemetryKey?: string;
33
- redirectUrl?: string;
34
- errorTransformer?: (error: {
35
- text: string;
36
- type: string;
37
- }) => string;
38
- form?: Record<string, any>;
39
- client?: Record<string, any>;
40
- styleId?: string;
41
- } & _1.RefAttributes<HTMLElement> & AdditionalProps>;
42
- declare const SignInFlow: _1.ComponentType<{
14
+ declare const Descope: React.ComponentType<AdditionalProps>;
15
+ declare const SignInFlow: React.ComponentType<{
43
16
  form?: Record<string, any>;
44
17
  onSuccess?: (e: CustomEvent<_descope_core_js_sdk.JWTResponse>) => void;
45
18
  onError?: (e: CustomEvent<{
@@ -66,7 +39,7 @@ declare const SignInFlow: _1.ComponentType<{
66
39
  client?: Record<string, any>;
67
40
  styleId?: string;
68
41
  } & AdditionalProps>;
69
- declare const SignUpFlow: _1.ComponentType<{
42
+ declare const SignUpFlow: React.ComponentType<{
70
43
  form?: Record<string, any>;
71
44
  onSuccess?: (e: CustomEvent<_descope_core_js_sdk.JWTResponse>) => void;
72
45
  onError?: (e: CustomEvent<{
@@ -93,7 +66,7 @@ declare const SignUpFlow: _1.ComponentType<{
93
66
  client?: Record<string, any>;
94
67
  styleId?: string;
95
68
  } & AdditionalProps>;
96
- declare const SignUpOrInFlow: _1.ComponentType<{
69
+ declare const SignUpOrInFlow: React.ComponentType<{
97
70
  form?: Record<string, any>;
98
71
  onSuccess?: (e: CustomEvent<_descope_core_js_sdk.JWTResponse>) => void;
99
72
  onError?: (e: CustomEvent<{
@@ -121,7 +94,7 @@ declare const SignUpOrInFlow: _1.ComponentType<{
121
94
  styleId?: string;
122
95
  } & AdditionalProps>;
123
96
 
124
- declare const UserManagement: _1.ComponentType<{
97
+ declare const UserManagement: ComponentType<{
125
98
  logger?: _descope_sdk_mixins_themeMixin.Logger;
126
99
  tenant: string;
127
100
  widgetId: string;
@@ -129,7 +102,7 @@ declare const UserManagement: _1.ComponentType<{
129
102
  debug?: boolean;
130
103
  styleId?: string;
131
104
  } & _1.RefAttributes<HTMLElement>>;
132
- declare const RoleManagement: _1.ComponentType<{
105
+ declare const RoleManagement: ComponentType<{
133
106
  logger?: _descope_sdk_mixins_themeMixin.Logger;
134
107
  tenant: string;
135
108
  widgetId: string;
@@ -137,7 +110,7 @@ declare const RoleManagement: _1.ComponentType<{
137
110
  debug?: boolean;
138
111
  styleId?: string;
139
112
  } & _1.RefAttributes<HTMLElement>>;
140
- declare const AccessKeyManagement: _1.ComponentType<{
113
+ declare const AccessKeyManagement: ComponentType<{
141
114
  logger?: _descope_sdk_mixins_themeMixin.Logger;
142
115
  tenant: string;
143
116
  widgetId: string;
@@ -145,7 +118,7 @@ declare const AccessKeyManagement: _1.ComponentType<{
145
118
  debug?: boolean;
146
119
  styleId?: string;
147
120
  } & _1.RefAttributes<HTMLElement>>;
148
- declare const AuditManagement: _1.ComponentType<{
121
+ declare const AuditManagement: ComponentType<{
149
122
  logger?: _descope_sdk_mixins_themeMixin.Logger;
150
123
  tenant: string;
151
124
  widgetId: string;
@@ -153,7 +126,7 @@ declare const AuditManagement: _1.ComponentType<{
153
126
  debug?: boolean;
154
127
  styleId?: string;
155
128
  } & _1.RefAttributes<HTMLElement>>;
156
- declare const UserProfile: _1.ComponentType<Omit<{
129
+ declare const UserProfile: ComponentType<Omit<{
157
130
  logger?: _descope_sdk_mixins_themeMixin.Logger;
158
131
  tenant: string;
159
132
  widgetId: string;
@@ -163,7 +136,7 @@ declare const UserProfile: _1.ComponentType<Omit<{
163
136
  }, "tenant"> & {
164
137
  onLogout?: (e: CustomEvent<any>) => void;
165
138
  } & _1.RefAttributes<HTMLElement>>;
166
- declare const ApplicationsPortal: _1.ComponentType<Omit<{
139
+ declare const ApplicationsPortal: ComponentType<Omit<{
167
140
  logger?: _descope_sdk_mixins_themeMixin.Logger;
168
141
  tenant: string;
169
142
  widgetId: string;
@@ -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.3.14"
4
+ 'x-descope-sdk-version': "0.3.15"
5
5
  };
6
6
  const DEFAULT_PUBLIC_ROUTES = {
7
7
  signIn: process.env.SIGN_IN_ROUTE || '/sign-in',
@@ -1,39 +1,11 @@
1
- /// <reference types="react" />
2
- import type * as _1 from '@descope/react-sdk/node_modules/@types/react';
3
1
  import type * as _2 from '@descope/react-sdk/node_modules/@descope/web-component/dist';
2
+ import React from 'react';
4
3
  type AdditionalProps = {
5
4
  redirectAfterSuccess?: string;
6
5
  redirectAfterError?: string;
7
6
  };
8
- export declare const Descope: _1.ComponentType<{
9
- flowId: string;
10
- onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
11
- onError?: (e: CustomEvent<{
12
- errorCode: string;
13
- errorDescription: string;
14
- errorMessage?: string;
15
- retryAfter?: string;
16
- }>) => void;
17
- onReady?: (e: CustomEvent<{}>) => void;
18
- logger?: _descope_sdk_mixins_themeMixin.Logger;
19
- tenant?: string;
20
- theme?: _2.ThemeOptions;
21
- locale?: string;
22
- autoFocus?: _2.AutoFocusOptions;
23
- validateOnBlur?: boolean;
24
- restartOnError?: boolean;
25
- debug?: boolean;
26
- telemetryKey?: string;
27
- redirectUrl?: string;
28
- errorTransformer?: (error: {
29
- text: string;
30
- type: string;
31
- }) => string;
32
- form?: Record<string, any>;
33
- client?: Record<string, any>;
34
- styleId?: string;
35
- } & _1.RefAttributes<HTMLElement> & AdditionalProps>;
36
- export declare const SignInFlow: _1.ComponentType<{
7
+ export declare const Descope: React.ComponentType<AdditionalProps>;
8
+ export declare const SignInFlow: React.ComponentType<{
37
9
  form?: Record<string, any>;
38
10
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
39
11
  onError?: (e: CustomEvent<{
@@ -60,7 +32,7 @@ export declare const SignInFlow: _1.ComponentType<{
60
32
  client?: Record<string, any>;
61
33
  styleId?: string;
62
34
  } & AdditionalProps>;
63
- export declare const SignUpFlow: _1.ComponentType<{
35
+ export declare const SignUpFlow: React.ComponentType<{
64
36
  form?: Record<string, any>;
65
37
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
66
38
  onError?: (e: CustomEvent<{
@@ -87,7 +59,7 @@ export declare const SignUpFlow: _1.ComponentType<{
87
59
  client?: Record<string, any>;
88
60
  styleId?: string;
89
61
  } & AdditionalProps>;
90
- export declare const SignUpOrInFlow: _1.ComponentType<{
62
+ export declare const SignUpOrInFlow: React.ComponentType<{
91
63
  form?: Record<string, any>;
92
64
  onSuccess?: (e: CustomEvent<import("@descope/core-js-sdk").JWTResponse>) => void;
93
65
  onError?: (e: CustomEvent<{
@@ -1,6 +1,6 @@
1
- /// <reference types="react" />
2
1
  import type * as _1 from '@descope/react-sdk/node_modules/@types/react';
3
- export declare const UserManagement: _1.ComponentType<{
2
+ import { ComponentType } from 'react';
3
+ export declare const UserManagement: ComponentType<{
4
4
  logger?: _descope_sdk_mixins_themeMixin.Logger;
5
5
  tenant: string;
6
6
  widgetId: string;
@@ -8,7 +8,7 @@ export declare const UserManagement: _1.ComponentType<{
8
8
  debug?: boolean;
9
9
  styleId?: string;
10
10
  } & _1.RefAttributes<HTMLElement>>;
11
- export declare const RoleManagement: _1.ComponentType<{
11
+ export declare const RoleManagement: ComponentType<{
12
12
  logger?: _descope_sdk_mixins_themeMixin.Logger;
13
13
  tenant: string;
14
14
  widgetId: string;
@@ -16,7 +16,7 @@ export declare const RoleManagement: _1.ComponentType<{
16
16
  debug?: boolean;
17
17
  styleId?: string;
18
18
  } & _1.RefAttributes<HTMLElement>>;
19
- export declare const AccessKeyManagement: _1.ComponentType<{
19
+ export declare const AccessKeyManagement: ComponentType<{
20
20
  logger?: _descope_sdk_mixins_themeMixin.Logger;
21
21
  tenant: string;
22
22
  widgetId: string;
@@ -24,7 +24,7 @@ export declare const AccessKeyManagement: _1.ComponentType<{
24
24
  debug?: boolean;
25
25
  styleId?: string;
26
26
  } & _1.RefAttributes<HTMLElement>>;
27
- export declare const AuditManagement: _1.ComponentType<{
27
+ export declare const AuditManagement: ComponentType<{
28
28
  logger?: _descope_sdk_mixins_themeMixin.Logger;
29
29
  tenant: string;
30
30
  widgetId: string;
@@ -32,7 +32,7 @@ export declare const AuditManagement: _1.ComponentType<{
32
32
  debug?: boolean;
33
33
  styleId?: string;
34
34
  } & _1.RefAttributes<HTMLElement>>;
35
- export declare const UserProfile: _1.ComponentType<Omit<{
35
+ export declare const UserProfile: ComponentType<Omit<{
36
36
  logger?: _descope_sdk_mixins_themeMixin.Logger;
37
37
  tenant: string;
38
38
  widgetId: string;
@@ -42,7 +42,7 @@ export declare const UserProfile: _1.ComponentType<Omit<{
42
42
  }, "tenant"> & {
43
43
  onLogout?: (e: CustomEvent<any>) => void;
44
44
  } & _1.RefAttributes<HTMLElement>>;
45
- export declare const ApplicationsPortal: _1.ComponentType<Omit<{
45
+ export declare const ApplicationsPortal: ComponentType<Omit<{
46
46
  logger?: _descope_sdk_mixins_themeMixin.Logger;
47
47
  tenant: string;
48
48
  widgetId: string;
@@ -16,7 +16,10 @@ const extractSession = (descopeSession) => {
16
16
  // returns the session token if it exists in the headers
17
17
  // This function require middleware
18
18
  const session = () => {
19
- const sessionHeader = headers()?.get(DESCOPE_SESSION_HEADER);
19
+ // from Next.js 15, headers() returns a Promise
20
+ // It can still be used synchronously to facilitate migration
21
+ const reqHeaders = headers();
22
+ const sessionHeader = reqHeaders.get(DESCOPE_SESSION_HEADER);
20
23
  return extractSession(sessionHeader);
21
24
  };
22
25
  // returns the session token if it exists in the request headers
@@ -1 +1 @@
1
- {"version":3,"file":"session.js","sources":["../../src/server/session.ts"],"sourcesContent":["import { AuthenticationInfo } from '@descope/node-sdk';\nimport { NextApiRequest } from 'next';\nimport { headers } from 'next/headers';\nimport { DESCOPE_SESSION_HEADER } from './constants';\n\nconst extractSession = (\n\tdescopeSession?: string\n): AuthenticationInfo | undefined => {\n\tif (!descopeSession) {\n\t\treturn undefined;\n\t}\n\ttry {\n\t\tconst authInfo = JSON.parse(\n\t\t\tBuffer.from(descopeSession, 'base64').toString()\n\t\t) as AuthenticationInfo;\n\t\treturn authInfo;\n\t} catch (err) {\n\t\treturn undefined;\n\t}\n};\n// returns the session token if it exists in the headers\n// This function require middleware\nexport const session = (): AuthenticationInfo | undefined => {\n\tconst sessionHeader = headers()?.get(DESCOPE_SESSION_HEADER);\n\treturn extractSession(sessionHeader);\n};\n\n// returns the session token if it exists in the request headers\n// This function require middleware\nexport const getSession = (\n\treq: NextApiRequest\n): AuthenticationInfo | undefined =>\n\textractSession(req.headers[DESCOPE_SESSION_HEADER.toLowerCase()] as string);\n"],"names":[],"mappings":";;;AAKA,MAAM,cAAc,GAAG,CACtB,cAAuB,KACY;IACnC,IAAI,CAAC,cAAc,EAAE;AACpB,QAAA,OAAO,SAAS,CAAC;KACjB;AACD,IAAA,IAAI;AACH,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAC1B,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAC1B,CAAC;AACxB,QAAA,OAAO,QAAQ,CAAC;KAChB;IAAC,OAAO,GAAG,EAAE;AACb,QAAA,OAAO,SAAS,CAAC;KACjB;AACF,CAAC,CAAC;AACF;AACA;AACO,MAAM,OAAO,GAAG,MAAqC;IAC3D,MAAM,aAAa,GAAG,OAAO,EAAE,EAAE,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAC7D,IAAA,OAAO,cAAc,CAAC,aAAa,CAAC,CAAC;AACtC,EAAE;AAEF;AACA;MACa,UAAU,GAAG,CACzB,GAAmB,KAEnB,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAW;;;;"}
1
+ {"version":3,"file":"session.js","sources":["../../src/server/session.ts"],"sourcesContent":["import { AuthenticationInfo } from '@descope/node-sdk';\nimport { NextApiRequest } from 'next';\nimport { headers } from 'next/headers';\nimport { DESCOPE_SESSION_HEADER } from './constants';\n\n// This type is declared to allow simpler migration to Next.15\n// It will be removed in the future\ntype HeaderTypes = Awaited<ReturnType<typeof headers>>;\n\nconst extractSession = (\n\tdescopeSession?: string\n): AuthenticationInfo | undefined => {\n\tif (!descopeSession) {\n\t\treturn undefined;\n\t}\n\ttry {\n\t\tconst authInfo = JSON.parse(\n\t\t\tBuffer.from(descopeSession, 'base64').toString()\n\t\t) as AuthenticationInfo;\n\t\treturn authInfo;\n\t} catch (err) {\n\t\treturn undefined;\n\t}\n};\n// returns the session token if it exists in the headers\n// This function require middleware\nexport const session = (): AuthenticationInfo | undefined => {\n\t// from Next.js 15, headers() returns a Promise\n\t// It can still be used synchronously to facilitate migration\n\tconst reqHeaders = headers() as never as HeaderTypes;\n\tconst sessionHeader = reqHeaders.get(DESCOPE_SESSION_HEADER);\n\treturn extractSession(sessionHeader);\n};\n\n// returns the session token if it exists in the request headers\n// This function require middleware\nexport const getSession = (\n\treq: NextApiRequest\n): AuthenticationInfo | undefined =>\n\textractSession(req.headers[DESCOPE_SESSION_HEADER.toLowerCase()] as string);\n"],"names":[],"mappings":";;;AASA,MAAM,cAAc,GAAG,CACtB,cAAuB,KACY;IACnC,IAAI,CAAC,cAAc,EAAE;AACpB,QAAA,OAAO,SAAS,CAAC;KACjB;AACD,IAAA,IAAI;AACH,QAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAC1B,MAAM,CAAC,IAAI,CAAC,cAAc,EAAE,QAAQ,CAAC,CAAC,QAAQ,EAAE,CAC1B,CAAC;AACxB,QAAA,OAAO,QAAQ,CAAC;KAChB;IAAC,OAAO,GAAG,EAAE;AACb,QAAA,OAAO,SAAS,CAAC;KACjB;AACF,CAAC,CAAC;AACF;AACA;AACO,MAAM,OAAO,GAAG,MAAqC;;;AAG3D,IAAA,MAAM,UAAU,GAAG,OAAO,EAA0B,CAAC;IACrD,MAAM,aAAa,GAAG,UAAU,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;AAC7D,IAAA,OAAO,cAAc,CAAC,aAAa,CAAC,CAAC;AACtC,EAAE;AAEF;AACA;MACa,UAAU,GAAG,CACzB,GAAmB,KAEnB,cAAc,CAAC,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,WAAW,EAAE,CAAW;;;;"}
@@ -1,7 +1,7 @@
1
1
  // eslint-disable-next-line import/prefer-default-export
2
2
  const baseHeaders = {
3
3
  'x-descope-sdk-name': 'nextjs',
4
- 'x-descope-sdk-version': "0.3.14"
4
+ 'x-descope-sdk-version': "0.3.15"
5
5
  };
6
6
 
7
7
  export { baseHeaders };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@descope/nextjs-sdk",
3
- "version": "0.3.14",
3
+ "version": "0.3.15",
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/core-js-sdk": "2.33.0",
65
- "@descope/react-sdk": "2.3.6",
66
- "@descope/web-component": "3.31.2"
64
+ "@descope/react-sdk": "2.3.7",
65
+ "@descope/web-component": "3.31.3",
66
+ "@descope/core-js-sdk": "2.33.0"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@babel/core": "7.23.9",
@@ -80,9 +80,6 @@
80
80
  "@testing-library/jest-dom": "^6.4.2",
81
81
  "@testing-library/react": "^14.2.1",
82
82
  "@types/jest": "^29.5.12",
83
- "@types/react": "18.3.3",
84
- "@types/react-dom": "18.2.18",
85
- "@types/react-router-dom": "^5.3.3",
86
83
  "babel": "^6.23.0",
87
84
  "babel-jest": "^27.5.1",
88
85
  "eslint": "8.56.0",