@stytch/nextjs 21.4.3 → 21.4.4

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @stytch/nextjs
2
2
 
3
+ ## 21.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - 54275c2: Make some minor improvements to JSDoc comments
8
+ - 54275c2: Add missing default generic type parameters
9
+
3
10
  ## 21.4.3
4
11
 
5
12
  ### Patch Changes
@@ -5,45 +5,98 @@ import { Member, MemberSession, Organization, StytchB2BUIClient } from '@stytch/
5
5
  import { StytchB2BHeadlessClient, StytchProjectConfigurationInput } from '@stytch/vanilla-js/b2b/headless';
6
6
  import { PermissionsMap } from '@stytch/core/public';
7
7
  /**
8
- * The Stytch Client object passed in to <StytchProvider /> in your `_app.js`.
9
- * Either a StytchUIClient or StytchHeadlessClient.
8
+ * The Stytch Client object passed in to <StytchB2BProvider /> in your application root.
9
+ * Either a StytchB2BUIClient or StytchB2BHeadlessClient.
10
10
  */
11
11
  type StytchB2BClient<TProjectConfiguration extends StytchProjectConfigurationInput> = StytchB2BHeadlessClient<TProjectConfiguration> | StytchB2BUIClient<TProjectConfiguration>;
12
12
  type SWRMember = {
13
+ /**
14
+ * Either the active {@link Member} object, or null if the member is not logged in.
15
+ */
13
16
  member: null;
17
+ /**
18
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
19
+ */
14
20
  fromCache: false;
21
+ /**
22
+ * If true, indicates that the SDK has completed initialization.
23
+ */
15
24
  isInitialized: false;
16
25
  } | {
26
+ /**
27
+ * Either the active {@link Member} object, or null if the member is not logged in.
28
+ */
17
29
  member: Member | null;
30
+ /**
31
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
32
+ */
18
33
  fromCache: boolean;
34
+ /**
35
+ * If true, indicates that the SDK has completed initialization.
36
+ */
19
37
  isInitialized: true;
20
38
  };
21
39
  type SWRMemberSession = {
40
+ /**
41
+ * Either the active {@link MemberSession} object, or null if the member is not logged in.
42
+ */
22
43
  session: null;
44
+ /**
45
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
46
+ */
23
47
  fromCache: false;
48
+ /**
49
+ * If true, indicates that the SDK has completed initialization.
50
+ */
24
51
  isInitialized: false;
25
52
  } | {
53
+ /**
54
+ * Either the active {@link MemberSession} object, or null if the member is not logged in.
55
+ */
26
56
  session: MemberSession | null;
57
+ /**
58
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
59
+ */
27
60
  fromCache: boolean;
61
+ /**
62
+ * If true, indicates that the SDK has completed initialization.
63
+ */
28
64
  isInitialized: true;
29
65
  };
30
66
  type SWROrganization = {
67
+ /**
68
+ * Either the active {@link Organization} object, or null if the member is not logged in.
69
+ */
31
70
  organization: null;
71
+ /**
72
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
73
+ */
32
74
  fromCache: false;
75
+ /**
76
+ * If true, indicates that the SDK has completed initialization.
77
+ */
33
78
  isInitialized: false;
34
79
  } | {
80
+ /**
81
+ * Either the active {@link Organization} object, or null if the member is not logged in.
82
+ */
35
83
  organization: Organization | null;
84
+ /**
85
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
86
+ */
36
87
  fromCache: boolean;
88
+ /**
89
+ * If true, indicates that the SDK has completed initialization.
90
+ */
37
91
  isInitialized: true;
38
92
  };
39
93
  declare const useIsMounted__INTERNAL: () => boolean;
40
94
  declare const isUIClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(client: StytchB2BClient<TProjectConfiguration>) => client is StytchB2BUIClient<TProjectConfiguration>;
41
95
  /**
42
- * Returns the active member.
96
+ * Returns the active Member.
43
97
  * The Stytch SDKs are used for client-side authentication and session management.
44
98
  * Check the isInitialized property to determine if the SDK has completed initialization.
45
- * Check the fromCache property to determine if the session data is from persistent storage.
46
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
99
+ * Check the fromCache property to determine if the member data is from persistent storage.
47
100
  * @example
48
101
  * const {member, isInitialized, fromCache} = useStytchMember();
49
102
  * if (!isInitialized) {
@@ -53,11 +106,10 @@ declare const isUIClient: <TProjectConfiguration extends Partial<import("@stytch
53
106
  */
54
107
  declare const useStytchMember: () => SWRMember;
55
108
  /**
56
- * Returns the member's active Stytch member session.
109
+ * Returns the active member's Stytch member session.
57
110
  * The Stytch SDKs are used for client-side authentication and session management.
58
111
  * Check the isInitialized property to determine if the SDK has completed initialization.
59
112
  * Check the fromCache property to determine if the session data is from persistent storage.
60
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
61
113
  * @example
62
114
  * const {session, isInitialized, fromCache} = useStytchMemberSession();
63
115
  * useEffect(() => {
@@ -74,8 +126,7 @@ declare const useStytchMemberSession: () => SWRMemberSession;
74
126
  * Returns the active Stytch organization.
75
127
  * The Stytch SDKs are used for client-side authentication and session management.
76
128
  * Check the isInitialized property to determine if the SDK has completed initialization.
77
- * Check the fromCache property to determine if the session data is from persistent storage.
78
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
129
+ * Check the fromCache property to determine if the organization data is from persistent storage.
79
130
  * @example
80
131
  * const {organization, isInitialized, fromCache} = useStytchOrganization();
81
132
  * if (!isInitialized) {
@@ -85,8 +136,17 @@ declare const useStytchMemberSession: () => SWRMemberSession;
85
136
  */
86
137
  declare const useStytchOrganization: () => SWROrganization;
87
138
  type SWRIsAuthorized = {
139
+ /**
140
+ * Whether the logged-in member is allowed to perform the specified action on the specified resource.
141
+ */
88
142
  isAuthorized: boolean;
143
+ /**
144
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
145
+ */
89
146
  fromCache: boolean;
147
+ /**
148
+ * If true, indicates that the SDK has completed initialization.
149
+ */
90
150
  isInitialized: boolean;
91
151
  };
92
152
  /**
@@ -103,15 +163,15 @@ type SWRIsAuthorized = {
103
163
  */
104
164
  declare const useStytchIsAuthorized: (resourceId: string, action: string) => SWRIsAuthorized;
105
165
  /**
106
- * Returns the Stytch client stored in the Stytch context.
166
+ * Returns the Stytch B2B client stored in the Stytch context.
107
167
  *
108
168
  * @example
109
- * const stytch = useStytch();
169
+ * const stytch = useStytchB2BClient();
110
170
  * useEffect(() => {
111
171
  * stytch.magicLinks.authenticate('...')
112
172
  * }, [stytch]);
113
173
  */
114
- declare const useStytchB2BClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>() => StytchB2BHeadlessClient<TProjectConfiguration>;
174
+ declare const useStytchB2BClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>() => StytchB2BHeadlessClient<TProjectConfiguration>;
115
175
  declare const withStytchB2BClient: <T extends object, TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(Component: React.ComponentType<T & {
116
176
  stytch: StytchB2BHeadlessClient<TProjectConfiguration>;
117
177
  }>) => React.ComponentType<T>;
@@ -154,7 +214,7 @@ declare const withStytchOrganization: <T extends object>(Component: React.Compon
154
214
  declare const withStytchPermissions: <Permissions_1 extends Record<string, string>, T extends object>(Component: React.ComponentType<T & {
155
215
  stytchPermissions: PermissionsMap<Permissions_1>;
156
216
  }>) => React.ComponentType<T>;
157
- interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput> {
217
+ interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> {
158
218
  /**
159
219
  * A Stytch client instance, created using either {@link createStytchHeadlessClient} or {@link createStytchUIClient}
160
220
  */
@@ -163,7 +223,7 @@ interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConf
163
223
  }
164
224
  /**
165
225
  * The Stytch Context Provider.
166
- * Wrap your application with this component in `_app.js` in order to use Stytch everywhere in your app.
226
+ * Wrap your application with this component in order to use Stytch everywhere in your app.
167
227
  * @example
168
228
  * const stytch = createStytchB2BHeadlessClient('public-token-<find yours in the stytch dashboard>')
169
229
  *
@@ -173,5 +233,5 @@ interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConf
173
233
  * </StytchB2BProvider>
174
234
  * )
175
235
  */
176
- declare const StytchB2BProvider: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>({ stytch, children, }: StytchB2BProviderProps<TProjectConfiguration>) => JSX.Element;
236
+ declare const StytchB2BProvider: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ stytch, children, }: StytchB2BProviderProps<TProjectConfiguration>) => JSX.Element;
177
237
  export { useIsMounted__INTERNAL, isUIClient, useStytchMember, useStytchMemberSession, useStytchOrganization, useStytchIsAuthorized, useStytchB2BClient, withStytchB2BClient, withStytchMember, withStytchMemberSession, withStytchOrganization, withStytchPermissions, StytchB2BProviderProps, StytchB2BProvider };
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var useIsomorphicLayoutEffect = require('./useIsomorphicLayoutEffect-a2b587d2.js');
4
+ var useIsomorphicLayoutEffect = require('./useIsomorphicLayoutEffect-65746ef3.js');
5
5
  var StytchSSRProxy = require('./StytchSSRProxy-c9d3bc41.js');
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -23,20 +23,19 @@ const initialOrganization = {
23
23
  fromCache: false,
24
24
  isInitialized: false,
25
25
  };
26
- const StytchContext = React.createContext({ isMounted: false });
26
+ const StytchB2BContext = React.createContext({ isMounted: false });
27
27
  const StytchMemberContext = React.createContext(initialMember);
28
28
  const StytchMemberSessionContext = React.createContext(initialMemberSession);
29
29
  const StytchOrganizationContext = React.createContext(initialOrganization);
30
- const useIsMounted__INTERNAL = () => React.useContext(StytchContext).isMounted;
30
+ const useIsMounted__INTERNAL = () => React.useContext(StytchB2BContext).isMounted;
31
31
  const isUIClient = (client) => {
32
32
  return client.mount !== undefined;
33
33
  };
34
34
  /**
35
- * Returns the active member.
35
+ * Returns the active Member.
36
36
  * The Stytch SDKs are used for client-side authentication and session management.
37
37
  * Check the isInitialized property to determine if the SDK has completed initialization.
38
- * Check the fromCache property to determine if the session data is from persistent storage.
39
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
38
+ * Check the fromCache property to determine if the member data is from persistent storage.
40
39
  * @example
41
40
  * const {member, isInitialized, fromCache} = useStytchMember();
42
41
  * if (!isInitialized) {
@@ -49,11 +48,10 @@ const useStytchMember = () => {
49
48
  return React.useContext(StytchMemberContext);
50
49
  };
51
50
  /**
52
- * Returns the member's active Stytch member session.
51
+ * Returns the active member's Stytch member session.
53
52
  * The Stytch SDKs are used for client-side authentication and session management.
54
53
  * Check the isInitialized property to determine if the SDK has completed initialization.
55
54
  * Check the fromCache property to determine if the session data is from persistent storage.
56
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
57
55
  * @example
58
56
  * const {session, isInitialized, fromCache} = useStytchMemberSession();
59
57
  * useEffect(() => {
@@ -73,8 +71,7 @@ const useStytchMemberSession = () => {
73
71
  * Returns the active Stytch organization.
74
72
  * The Stytch SDKs are used for client-side authentication and session management.
75
73
  * Check the isInitialized property to determine if the SDK has completed initialization.
76
- * Check the fromCache property to determine if the session data is from persistent storage.
77
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
74
+ * Check the fromCache property to determine if the organization data is from persistent storage.
78
75
  * @example
79
76
  * const {organization, isInitialized, fromCache} = useStytchOrganization();
80
77
  * if (!isInitialized) {
@@ -128,16 +125,16 @@ const useStytchIsAuthorized = (resourceId, action) => {
128
125
  return isAuthorized;
129
126
  };
130
127
  /**
131
- * Returns the Stytch client stored in the Stytch context.
128
+ * Returns the Stytch B2B client stored in the Stytch context.
132
129
  *
133
130
  * @example
134
- * const stytch = useStytch();
131
+ * const stytch = useStytchB2BClient();
135
132
  * useEffect(() => {
136
133
  * stytch.magicLinks.authenticate('...')
137
134
  * }, [stytch]);
138
135
  */
139
136
  const useStytchB2BClient = () => {
140
- const ctx = React.useContext(StytchContext);
137
+ const ctx = React.useContext(StytchB2BContext);
141
138
  useIsomorphicLayoutEffect.invariant(ctx.isMounted, StytchSSRProxy.noProviderError('useStytchB2BClient', 'StytchB2BProvider'));
142
139
  return ctx.client;
143
140
  };
@@ -218,7 +215,7 @@ const withStytchPermissions = (Component) => {
218
215
  };
219
216
  /**
220
217
  * The Stytch Context Provider.
221
- * Wrap your application with this component in `_app.js` in order to use Stytch everywhere in your app.
218
+ * Wrap your application with this component in order to use Stytch everywhere in your app.
222
219
  * @example
223
220
  * const stytch = createStytchB2BHeadlessClient('public-token-<find yours in the stytch dashboard>')
224
221
  *
@@ -255,7 +252,7 @@ const StytchB2BProvider = ({ stytch, children, }) => {
255
252
  });
256
253
  });
257
254
  }, [setClientState, stytch]);
258
- return (React__default["default"].createElement(StytchContext.Provider, { value: ctx },
255
+ return (React__default["default"].createElement(StytchB2BContext.Provider, { value: ctx },
259
256
  React__default["default"].createElement(StytchOrganizationContext.Provider, { value: organization },
260
257
  React__default["default"].createElement(StytchMemberContext.Provider, { value: member },
261
258
  React__default["default"].createElement(StytchMemberSessionContext.Provider, { value: session }, children)))));
@@ -5,45 +5,98 @@ import { Member, MemberSession, Organization, StytchB2BUIClient } from '@stytch/
5
5
  import { StytchB2BHeadlessClient, StytchProjectConfigurationInput } from '@stytch/vanilla-js/b2b/headless';
6
6
  import { PermissionsMap } from '@stytch/core/public';
7
7
  /**
8
- * The Stytch Client object passed in to <StytchProvider /> in your `_app.js`.
9
- * Either a StytchUIClient or StytchHeadlessClient.
8
+ * The Stytch Client object passed in to <StytchB2BProvider /> in your application root.
9
+ * Either a StytchB2BUIClient or StytchB2BHeadlessClient.
10
10
  */
11
11
  type StytchB2BClient<TProjectConfiguration extends StytchProjectConfigurationInput> = StytchB2BHeadlessClient<TProjectConfiguration> | StytchB2BUIClient<TProjectConfiguration>;
12
12
  type SWRMember = {
13
+ /**
14
+ * Either the active {@link Member} object, or null if the member is not logged in.
15
+ */
13
16
  member: null;
17
+ /**
18
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
19
+ */
14
20
  fromCache: false;
21
+ /**
22
+ * If true, indicates that the SDK has completed initialization.
23
+ */
15
24
  isInitialized: false;
16
25
  } | {
26
+ /**
27
+ * Either the active {@link Member} object, or null if the member is not logged in.
28
+ */
17
29
  member: Member | null;
30
+ /**
31
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
32
+ */
18
33
  fromCache: boolean;
34
+ /**
35
+ * If true, indicates that the SDK has completed initialization.
36
+ */
19
37
  isInitialized: true;
20
38
  };
21
39
  type SWRMemberSession = {
40
+ /**
41
+ * Either the active {@link MemberSession} object, or null if the member is not logged in.
42
+ */
22
43
  session: null;
44
+ /**
45
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
46
+ */
23
47
  fromCache: false;
48
+ /**
49
+ * If true, indicates that the SDK has completed initialization.
50
+ */
24
51
  isInitialized: false;
25
52
  } | {
53
+ /**
54
+ * Either the active {@link MemberSession} object, or null if the member is not logged in.
55
+ */
26
56
  session: MemberSession | null;
57
+ /**
58
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
59
+ */
27
60
  fromCache: boolean;
61
+ /**
62
+ * If true, indicates that the SDK has completed initialization.
63
+ */
28
64
  isInitialized: true;
29
65
  };
30
66
  type SWROrganization = {
67
+ /**
68
+ * Either the active {@link Organization} object, or null if the member is not logged in.
69
+ */
31
70
  organization: null;
71
+ /**
72
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
73
+ */
32
74
  fromCache: false;
75
+ /**
76
+ * If true, indicates that the SDK has completed initialization.
77
+ */
33
78
  isInitialized: false;
34
79
  } | {
80
+ /**
81
+ * Either the active {@link Organization} object, or null if the member is not logged in.
82
+ */
35
83
  organization: Organization | null;
84
+ /**
85
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
86
+ */
36
87
  fromCache: boolean;
88
+ /**
89
+ * If true, indicates that the SDK has completed initialization.
90
+ */
37
91
  isInitialized: true;
38
92
  };
39
93
  declare const useIsMounted__INTERNAL: () => boolean;
40
94
  declare const isUIClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(client: StytchB2BClient<TProjectConfiguration>) => client is StytchB2BUIClient<TProjectConfiguration>;
41
95
  /**
42
- * Returns the active member.
96
+ * Returns the active Member.
43
97
  * The Stytch SDKs are used for client-side authentication and session management.
44
98
  * Check the isInitialized property to determine if the SDK has completed initialization.
45
- * Check the fromCache property to determine if the session data is from persistent storage.
46
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
99
+ * Check the fromCache property to determine if the member data is from persistent storage.
47
100
  * @example
48
101
  * const {member, isInitialized, fromCache} = useStytchMember();
49
102
  * if (!isInitialized) {
@@ -53,11 +106,10 @@ declare const isUIClient: <TProjectConfiguration extends Partial<import("@stytch
53
106
  */
54
107
  declare const useStytchMember: () => SWRMember;
55
108
  /**
56
- * Returns the member's active Stytch member session.
109
+ * Returns the active member's Stytch member session.
57
110
  * The Stytch SDKs are used for client-side authentication and session management.
58
111
  * Check the isInitialized property to determine if the SDK has completed initialization.
59
112
  * Check the fromCache property to determine if the session data is from persistent storage.
60
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
61
113
  * @example
62
114
  * const {session, isInitialized, fromCache} = useStytchMemberSession();
63
115
  * useEffect(() => {
@@ -74,8 +126,7 @@ declare const useStytchMemberSession: () => SWRMemberSession;
74
126
  * Returns the active Stytch organization.
75
127
  * The Stytch SDKs are used for client-side authentication and session management.
76
128
  * Check the isInitialized property to determine if the SDK has completed initialization.
77
- * Check the fromCache property to determine if the session data is from persistent storage.
78
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
129
+ * Check the fromCache property to determine if the organization data is from persistent storage.
79
130
  * @example
80
131
  * const {organization, isInitialized, fromCache} = useStytchOrganization();
81
132
  * if (!isInitialized) {
@@ -85,8 +136,17 @@ declare const useStytchMemberSession: () => SWRMemberSession;
85
136
  */
86
137
  declare const useStytchOrganization: () => SWROrganization;
87
138
  type SWRIsAuthorized = {
139
+ /**
140
+ * Whether the logged-in member is allowed to perform the specified action on the specified resource.
141
+ */
88
142
  isAuthorized: boolean;
143
+ /**
144
+ * If true, indicates that the value returned is from the application cache and a state refresh is in progress.
145
+ */
89
146
  fromCache: boolean;
147
+ /**
148
+ * If true, indicates that the SDK has completed initialization.
149
+ */
90
150
  isInitialized: boolean;
91
151
  };
92
152
  /**
@@ -103,15 +163,15 @@ type SWRIsAuthorized = {
103
163
  */
104
164
  declare const useStytchIsAuthorized: (resourceId: string, action: string) => SWRIsAuthorized;
105
165
  /**
106
- * Returns the Stytch client stored in the Stytch context.
166
+ * Returns the Stytch B2B client stored in the Stytch context.
107
167
  *
108
168
  * @example
109
- * const stytch = useStytch();
169
+ * const stytch = useStytchB2BClient();
110
170
  * useEffect(() => {
111
171
  * stytch.magicLinks.authenticate('...')
112
172
  * }, [stytch]);
113
173
  */
114
- declare const useStytchB2BClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>() => StytchB2BHeadlessClient<TProjectConfiguration>;
174
+ declare const useStytchB2BClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>() => StytchB2BHeadlessClient<TProjectConfiguration>;
115
175
  declare const withStytchB2BClient: <T extends object, TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(Component: React.ComponentType<T & {
116
176
  stytch: StytchB2BHeadlessClient<TProjectConfiguration>;
117
177
  }>) => React.ComponentType<T>;
@@ -154,7 +214,7 @@ declare const withStytchOrganization: <T extends object>(Component: React.Compon
154
214
  declare const withStytchPermissions: <Permissions_1 extends Record<string, string>, T extends object>(Component: React.ComponentType<T & {
155
215
  stytchPermissions: PermissionsMap<Permissions_1>;
156
216
  }>) => React.ComponentType<T>;
157
- interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput> {
217
+ interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> {
158
218
  /**
159
219
  * A Stytch client instance, created using either {@link createStytchHeadlessClient} or {@link createStytchUIClient}
160
220
  */
@@ -163,7 +223,7 @@ interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConf
163
223
  }
164
224
  /**
165
225
  * The Stytch Context Provider.
166
- * Wrap your application with this component in `_app.js` in order to use Stytch everywhere in your app.
226
+ * Wrap your application with this component in order to use Stytch everywhere in your app.
167
227
  * @example
168
228
  * const stytch = createStytchB2BHeadlessClient('public-token-<find yours in the stytch dashboard>')
169
229
  *
@@ -173,5 +233,5 @@ interface StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConf
173
233
  * </StytchB2BProvider>
174
234
  * )
175
235
  */
176
- declare const StytchB2BProvider: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>({ stytch, children, }: StytchB2BProviderProps<TProjectConfiguration>) => JSX.Element;
236
+ declare const StytchB2BProvider: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ stytch, children, }: StytchB2BProviderProps<TProjectConfiguration>) => JSX.Element;
177
237
  export { useIsMounted__INTERNAL, isUIClient, useStytchMember, useStytchMemberSession, useStytchOrganization, useStytchIsAuthorized, useStytchB2BClient, withStytchB2BClient, withStytchMember, withStytchMemberSession, withStytchOrganization, withStytchPermissions, StytchB2BProviderProps, StytchB2BProvider };
@@ -1,5 +1,5 @@
1
1
  import React, { createContext, useContext, useEffect, useMemo } from 'react';
2
- import { i as invariant, u as useAsyncState, m as mergeWithStableProps } from './useIsomorphicLayoutEffect-2962f7c7.js';
2
+ import { i as invariant, u as useAsyncState, m as mergeWithStableProps } from './useIsomorphicLayoutEffect-1babb81e.js';
3
3
  import { i as isStytchSSRProxy, n as noProviderError } from './StytchSSRProxy-4e34fb34.js';
4
4
 
5
5
  const initialMember = {
@@ -17,20 +17,19 @@ const initialOrganization = {
17
17
  fromCache: false,
18
18
  isInitialized: false,
19
19
  };
20
- const StytchContext = createContext({ isMounted: false });
20
+ const StytchB2BContext = createContext({ isMounted: false });
21
21
  const StytchMemberContext = createContext(initialMember);
22
22
  const StytchMemberSessionContext = createContext(initialMemberSession);
23
23
  const StytchOrganizationContext = createContext(initialOrganization);
24
- const useIsMounted__INTERNAL = () => useContext(StytchContext).isMounted;
24
+ const useIsMounted__INTERNAL = () => useContext(StytchB2BContext).isMounted;
25
25
  const isUIClient = (client) => {
26
26
  return client.mount !== undefined;
27
27
  };
28
28
  /**
29
- * Returns the active member.
29
+ * Returns the active Member.
30
30
  * The Stytch SDKs are used for client-side authentication and session management.
31
31
  * Check the isInitialized property to determine if the SDK has completed initialization.
32
- * Check the fromCache property to determine if the session data is from persistent storage.
33
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
32
+ * Check the fromCache property to determine if the member data is from persistent storage.
34
33
  * @example
35
34
  * const {member, isInitialized, fromCache} = useStytchMember();
36
35
  * if (!isInitialized) {
@@ -43,11 +42,10 @@ const useStytchMember = () => {
43
42
  return useContext(StytchMemberContext);
44
43
  };
45
44
  /**
46
- * Returns the member's active Stytch member session.
45
+ * Returns the active member's Stytch member session.
47
46
  * The Stytch SDKs are used for client-side authentication and session management.
48
47
  * Check the isInitialized property to determine if the SDK has completed initialization.
49
48
  * Check the fromCache property to determine if the session data is from persistent storage.
50
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
51
49
  * @example
52
50
  * const {session, isInitialized, fromCache} = useStytchMemberSession();
53
51
  * useEffect(() => {
@@ -67,8 +65,7 @@ const useStytchMemberSession = () => {
67
65
  * Returns the active Stytch organization.
68
66
  * The Stytch SDKs are used for client-side authentication and session management.
69
67
  * Check the isInitialized property to determine if the SDK has completed initialization.
70
- * Check the fromCache property to determine if the session data is from persistent storage.
71
- * See Next's {@link https://nextjs.org/docs/authentication#authenticating-statically-generated-pages documentation} for more.
68
+ * Check the fromCache property to determine if the organization data is from persistent storage.
72
69
  * @example
73
70
  * const {organization, isInitialized, fromCache} = useStytchOrganization();
74
71
  * if (!isInitialized) {
@@ -122,16 +119,16 @@ const useStytchIsAuthorized = (resourceId, action) => {
122
119
  return isAuthorized;
123
120
  };
124
121
  /**
125
- * Returns the Stytch client stored in the Stytch context.
122
+ * Returns the Stytch B2B client stored in the Stytch context.
126
123
  *
127
124
  * @example
128
- * const stytch = useStytch();
125
+ * const stytch = useStytchB2BClient();
129
126
  * useEffect(() => {
130
127
  * stytch.magicLinks.authenticate('...')
131
128
  * }, [stytch]);
132
129
  */
133
130
  const useStytchB2BClient = () => {
134
- const ctx = useContext(StytchContext);
131
+ const ctx = useContext(StytchB2BContext);
135
132
  invariant(ctx.isMounted, noProviderError('useStytchB2BClient', 'StytchB2BProvider'));
136
133
  return ctx.client;
137
134
  };
@@ -212,7 +209,7 @@ const withStytchPermissions = (Component) => {
212
209
  };
213
210
  /**
214
211
  * The Stytch Context Provider.
215
- * Wrap your application with this component in `_app.js` in order to use Stytch everywhere in your app.
212
+ * Wrap your application with this component in order to use Stytch everywhere in your app.
216
213
  * @example
217
214
  * const stytch = createStytchB2BHeadlessClient('public-token-<find yours in the stytch dashboard>')
218
215
  *
@@ -249,7 +246,7 @@ const StytchB2BProvider = ({ stytch, children, }) => {
249
246
  });
250
247
  });
251
248
  }, [setClientState, stytch]);
252
- return (React.createElement(StytchContext.Provider, { value: ctx },
249
+ return (React.createElement(StytchB2BContext.Provider, { value: ctx },
253
250
  React.createElement(StytchOrganizationContext.Provider, { value: organization },
254
251
  React.createElement(StytchMemberContext.Provider, { value: member },
255
252
  React.createElement(StytchMemberSessionContext.Provider, { value: session }, children)))));
@@ -1,9 +1,9 @@
1
1
  import { mountAdminPortalSSO, mountAdminPortalOrgSettings, mountAdminPortalMemberManagement, mountAdminPortalSCIM } from '@stytch/vanilla-js/b2b/adminPortal';
2
2
  export { AdminPortalB2BProducts } from '@stytch/vanilla-js/b2b/adminPortal';
3
3
  import React, { useRef } from 'react';
4
- import { u as useIsMounted__INTERNAL, a as useStytchB2BClient } from '../StytchB2BContext-a2d58b5b.js';
4
+ import { u as useIsMounted__INTERNAL, a as useStytchB2BClient } from '../StytchB2BContext-c11ed503.js';
5
5
  import { n as noProviderError } from '../StytchSSRProxy-4e34fb34.js';
6
- import { i as invariant, a as useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect-2962f7c7.js';
6
+ import { i as invariant, a as useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect-1babb81e.js';
7
7
 
8
8
  const makeAdminPortalComponent = (mountFn, componentName) => {
9
9
  const Component = (props) => {
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var adminPortal = require('@stytch/vanilla-js/b2b/adminPortal');
6
6
  var React = require('react');
7
- var StytchB2BContext = require('../StytchB2BContext-fc9fdcb3.js');
7
+ var StytchB2BContext = require('../StytchB2BContext-a27d4ac7.js');
8
8
  var StytchSSRProxy = require('../StytchSSRProxy-c9d3bc41.js');
9
- var useIsomorphicLayoutEffect = require('../useIsomorphicLayoutEffect-a2b587d2.js');
9
+ var useIsomorphicLayoutEffect = require('../useIsomorphicLayoutEffect-65746ef3.js');
10
10
 
11
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
12