@stytch/nextjs 21.1.0 → 21.1.1
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 +12 -1
- package/dist/{StytchB2BContext-82437b10.js → StytchB2BContext-f05101de.js} +9 -9
- package/dist/adminPortal/index.d.ts +1 -1
- package/dist/adminPortal/index.esm.d.ts +1 -1
- package/dist/adminPortal/index.js +3 -5
- package/dist/b2b/index.d.ts +2 -2
- package/dist/b2b/index.esm.js +1 -1
- package/dist/b2b/index.js +3 -3
- package/dist/index.js +9 -9
- package/package.json +3 -3
- /package/dist/{StytchB2BContext-82437b10.d.ts → StytchB2BContext-f05101de.d.ts} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @stytch/nextjs
|
|
2
2
|
|
|
3
|
+
## 21.1.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 26a2e95: Fixed <StytchB2B /> error message
|
|
8
|
+
|
|
3
9
|
## 21.1.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
|
@@ -8,6 +14,12 @@
|
|
|
8
14
|
|
|
9
15
|
## 21.0.0
|
|
10
16
|
|
|
17
|
+
### Major Changes
|
|
18
|
+
|
|
19
|
+
- Updated API routes to use api.stytch.com for live and test.stytch.com for test, replacing web.stytch.com.
|
|
20
|
+
If you use Content Security Policy (CSP) headers, ensure the URL is updated.
|
|
21
|
+
This was done to reduce the number of network calls and simplify internal routing, resulting in faster API response times—improving request speeds by up to 40 milliseconds roundtrip.
|
|
22
|
+
|
|
11
23
|
### Patch Changes
|
|
12
24
|
|
|
13
25
|
- Updated dependencies [3c39a997]
|
|
@@ -86,7 +98,6 @@
|
|
|
86
98
|
### Patch Changes
|
|
87
99
|
|
|
88
100
|
- 50de202: Fix B2B headless entrypoint to import `@stytch/vanilla-js` rather than bundle it
|
|
89
|
-
- @stytch/vanilla-js@4.4.3
|
|
90
101
|
|
|
91
102
|
## 17.0.0
|
|
92
103
|
|
|
@@ -144,7 +144,7 @@ const useStytchB2BClient = () => {
|
|
|
144
144
|
const withStytchB2BClient = (Component) => {
|
|
145
145
|
const WithStytch = (props) => {
|
|
146
146
|
async.invariant(useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('withStytchB2BClient', 'StytchB2BProvider'));
|
|
147
|
-
return React__default[
|
|
147
|
+
return React__default["default"].createElement(Component, Object.assign({}, props, { stytch: useStytchB2BClient() }));
|
|
148
148
|
};
|
|
149
149
|
WithStytch.displayName = `withStytch(${Component.displayName || Component.name || 'Component'})`;
|
|
150
150
|
return WithStytch;
|
|
@@ -153,7 +153,7 @@ const withStytchMember = (Component) => {
|
|
|
153
153
|
const WithStytchUser = (props) => {
|
|
154
154
|
async.invariant(useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('withStytchMember', 'StytchB2BProvider'));
|
|
155
155
|
const { member, isInitialized, fromCache } = useStytchMember();
|
|
156
|
-
return (React__default[
|
|
156
|
+
return (React__default["default"].createElement(Component, Object.assign({}, props, { stytchMember: member, stytchMemberIsInitialized: isInitialized, stytchMemberIsFromCache: fromCache })));
|
|
157
157
|
};
|
|
158
158
|
WithStytchUser.displayName = `withStytchMember(${Component.displayName || Component.name || 'Component'})`;
|
|
159
159
|
return WithStytchUser;
|
|
@@ -162,7 +162,7 @@ const withStytchMemberSession = (Component) => {
|
|
|
162
162
|
const WithStytchSession = (props) => {
|
|
163
163
|
async.invariant(useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('withStytchMemberSession', 'StytchB2BProvider'));
|
|
164
164
|
const { session, isInitialized, fromCache } = useStytchMemberSession();
|
|
165
|
-
return (React__default[
|
|
165
|
+
return (React__default["default"].createElement(Component, Object.assign({}, props, { stytchMemberSession: session, stytchMemberSessionIsInitialized: isInitialized, stytchMemberSessionIsFromCache: fromCache })));
|
|
166
166
|
};
|
|
167
167
|
WithStytchSession.displayName = `withStytchMemberSession(${Component.displayName || Component.name || 'Component'})`;
|
|
168
168
|
return WithStytchSession;
|
|
@@ -171,7 +171,7 @@ const withStytchOrganization = (Component) => {
|
|
|
171
171
|
const WithStytchOrganization = (props) => {
|
|
172
172
|
async.invariant(useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('withStytchOrganization', 'StytchB2BProvider'));
|
|
173
173
|
const { organization, isInitialized, fromCache } = useStytchOrganization();
|
|
174
|
-
return (React__default[
|
|
174
|
+
return (React__default["default"].createElement(Component, Object.assign({}, props, { stytchOrganization: organization, stytchOrganizationIsInitialized: isInitialized, stytchOrganizationIsFromCache: fromCache })));
|
|
175
175
|
};
|
|
176
176
|
WithStytchOrganization.displayName = `withStytchOrganization(${Component.displayName || Component.name || 'Component'})`;
|
|
177
177
|
return WithStytchOrganization;
|
|
@@ -211,7 +211,7 @@ const withStytchPermissions = (Component) => {
|
|
|
211
211
|
if (!permissions.loaded) {
|
|
212
212
|
return null;
|
|
213
213
|
}
|
|
214
|
-
return React__default[
|
|
214
|
+
return React__default["default"].createElement(Component, Object.assign({}, props, { stytchPermissions: permissions.value }));
|
|
215
215
|
};
|
|
216
216
|
WithStytchPermissions.displayName = `withStytchPermissions(${Component.displayName || Component.name || 'Component'})`;
|
|
217
217
|
return WithStytchPermissions;
|
|
@@ -255,10 +255,10 @@ const StytchB2BProvider = ({ stytch, children }) => {
|
|
|
255
255
|
});
|
|
256
256
|
});
|
|
257
257
|
}, [setClientState, stytch]);
|
|
258
|
-
return (React__default[
|
|
259
|
-
React__default[
|
|
260
|
-
React__default[
|
|
261
|
-
React__default[
|
|
258
|
+
return (React__default["default"].createElement(StytchContext.Provider, { value: ctx },
|
|
259
|
+
React__default["default"].createElement(StytchOrganizationContext.Provider, { value: organization },
|
|
260
|
+
React__default["default"].createElement(StytchMemberContext.Provider, { value: member },
|
|
261
|
+
React__default["default"].createElement(StytchMemberSessionContext.Provider, { value: session }, children)))));
|
|
262
262
|
};
|
|
263
263
|
|
|
264
264
|
exports.StytchB2BProvider = StytchB2BProvider;
|
|
@@ -37,7 +37,7 @@ type AdminPortalSCIMProps = ExcludeInjectedOptions<AdminPortalSCIMMountOptions>;
|
|
|
37
37
|
*
|
|
38
38
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
39
39
|
*/
|
|
40
|
-
declare const AdminPortalSCIM: (props: ExcludeInjectedOptions<
|
|
40
|
+
declare const AdminPortalSCIM: (props: ExcludeInjectedOptions<AdminPortalSCIMMountOptions>) => JSX.Element;
|
|
41
41
|
export { AdminPortalSSO, AdminPortalOrgSettings, AdminPortalMemberManagement, AdminPortalSCIM };
|
|
42
42
|
export { AdminPortalB2BProducts } from "@stytch/vanilla-js/b2b/adminPortal";
|
|
43
43
|
export type { AdminPortalSSOProps, AdminPortalOrgSettingsProps, AdminPortalMemberManagementProps, AdminPortalSCIMProps };
|
|
@@ -37,7 +37,7 @@ type AdminPortalSCIMProps = ExcludeInjectedOptions<AdminPortalSCIMMountOptions>;
|
|
|
37
37
|
*
|
|
38
38
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
39
39
|
*/
|
|
40
|
-
declare const AdminPortalSCIM: (props: ExcludeInjectedOptions<
|
|
40
|
+
declare const AdminPortalSCIM: (props: ExcludeInjectedOptions<AdminPortalSCIMMountOptions>) => JSX.Element;
|
|
41
41
|
export { AdminPortalSSO, AdminPortalOrgSettings, AdminPortalMemberManagement, AdminPortalSCIM };
|
|
42
42
|
export { AdminPortalB2BProducts } from "@stytch/vanilla-js/b2b/adminPortal";
|
|
43
43
|
export type { AdminPortalSSOProps, AdminPortalOrgSettingsProps, AdminPortalMemberManagementProps, AdminPortalSCIMProps };
|
|
@@ -4,7 +4,7 @@ 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-
|
|
7
|
+
var StytchB2BContext = require('../StytchB2BContext-f05101de.js');
|
|
8
8
|
var StytchSSRProxy = require('../StytchSSRProxy-63bc6323.js');
|
|
9
9
|
var async = require('../async-86a7f0d6.js');
|
|
10
10
|
|
|
@@ -23,7 +23,7 @@ const makeAdminPortalComponent = (mountFn, componentName) => {
|
|
|
23
23
|
}
|
|
24
24
|
mountFn(Object.assign(Object.assign({}, props), { client: stytchClient, element: containerEl.current }));
|
|
25
25
|
}, [stytchClient, props]);
|
|
26
|
-
return React__default[
|
|
26
|
+
return React__default["default"].createElement("div", { ref: containerEl });
|
|
27
27
|
};
|
|
28
28
|
return Component;
|
|
29
29
|
};
|
|
@@ -62,9 +62,7 @@ const AdminPortalSCIM = makeAdminPortalComponent(adminPortal.mountAdminPortalSCI
|
|
|
62
62
|
|
|
63
63
|
Object.defineProperty(exports, 'AdminPortalB2BProducts', {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () {
|
|
66
|
-
return adminPortal.AdminPortalB2BProducts;
|
|
67
|
-
}
|
|
65
|
+
get: function () { return adminPortal.AdminPortalB2BProducts; }
|
|
68
66
|
});
|
|
69
67
|
exports.AdminPortalMemberManagement = AdminPortalMemberManagement;
|
|
70
68
|
exports.AdminPortalOrgSettings = AdminPortalOrgSettings;
|
package/dist/b2b/index.d.ts
CHANGED
|
@@ -103,6 +103,6 @@ interface StytchB2BProps {
|
|
|
103
103
|
* @param props {@link StytchB2BProps}
|
|
104
104
|
*/
|
|
105
105
|
declare const StytchB2B: ({ styles, callbacks, config }: StytchB2BProps) => React.JSX.Element;
|
|
106
|
-
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-
|
|
106
|
+
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-f05101de.js";
|
|
107
107
|
export { StytchB2B };
|
|
108
|
-
export type { StytchB2BProviderProps } from "../StytchB2BContext-
|
|
108
|
+
export type { StytchB2BProviderProps } from "../StytchB2BContext-f05101de.js";
|
package/dist/b2b/index.esm.js
CHANGED
|
@@ -39,7 +39,7 @@ import { a as noHeadlessClientError, n as noProviderError } from '../StytchSSRPr
|
|
|
39
39
|
* @param props {@link StytchB2BProps}
|
|
40
40
|
*/
|
|
41
41
|
const StytchB2B = ({ styles, callbacks, config }) => {
|
|
42
|
-
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchB2B />'));
|
|
42
|
+
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchB2B />', 'StytchB2BProvider'));
|
|
43
43
|
const stytchClient = useStytchB2BClient();
|
|
44
44
|
const containerEl = useRef(null);
|
|
45
45
|
useLayoutEffect(() => {
|
package/dist/b2b/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var StytchB2BContext = require('../StytchB2BContext-
|
|
5
|
+
var StytchB2BContext = require('../StytchB2BContext-f05101de.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var async = require('../async-86a7f0d6.js');
|
|
8
8
|
var StytchSSRProxy = require('../StytchSSRProxy-63bc6323.js');
|
|
@@ -46,7 +46,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
46
46
|
* @param props {@link StytchB2BProps}
|
|
47
47
|
*/
|
|
48
48
|
const StytchB2B = ({ styles, callbacks, config }) => {
|
|
49
|
-
async.invariant(StytchB2BContext.useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('<StytchB2B />'));
|
|
49
|
+
async.invariant(StytchB2BContext.useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('<StytchB2B />', 'StytchB2BProvider'));
|
|
50
50
|
const stytchClient = StytchB2BContext.useStytchB2BClient();
|
|
51
51
|
const containerEl = React.useRef(null);
|
|
52
52
|
React.useLayoutEffect(() => {
|
|
@@ -68,7 +68,7 @@ const StytchB2B = ({ styles, callbacks, config }) => {
|
|
|
68
68
|
});
|
|
69
69
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- SDK-1354
|
|
70
70
|
}, [stytchClient, styles, callbacks]);
|
|
71
|
-
return React__default[
|
|
71
|
+
return React__default["default"].createElement("div", { ref: containerEl });
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
exports.StytchB2BProvider = StytchB2BContext.StytchB2BProvider;
|
package/dist/index.js
CHANGED
|
@@ -82,7 +82,7 @@ const useStytch = () => {
|
|
|
82
82
|
const withStytch = (Component) => {
|
|
83
83
|
const WithStytch = (props) => {
|
|
84
84
|
async.invariant(useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('withStytch'));
|
|
85
|
-
return React__default[
|
|
85
|
+
return React__default["default"].createElement(Component, Object.assign({}, props, { stytch: useStytch() }));
|
|
86
86
|
};
|
|
87
87
|
WithStytch.displayName = `withStytch(${Component.displayName || Component.name || 'Component'})`;
|
|
88
88
|
return WithStytch;
|
|
@@ -91,7 +91,7 @@ const withStytchUser = (Component) => {
|
|
|
91
91
|
const WithStytchUser = (props) => {
|
|
92
92
|
async.invariant(useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('withStytchUser'));
|
|
93
93
|
const { user, isInitialized, fromCache } = useStytchUser();
|
|
94
|
-
return (React__default[
|
|
94
|
+
return (React__default["default"].createElement(Component, Object.assign({}, props, { stytchUser: user, stytchUserIsInitialized: isInitialized, stytchUserIsFromCache: fromCache })));
|
|
95
95
|
};
|
|
96
96
|
WithStytchUser.displayName = `withStytchUser(${Component.displayName || Component.name || 'Component'})`;
|
|
97
97
|
return WithStytchUser;
|
|
@@ -100,7 +100,7 @@ const withStytchSession = (Component) => {
|
|
|
100
100
|
const WithStytchSession = (props) => {
|
|
101
101
|
async.invariant(useIsMounted__INTERNAL(), StytchSSRProxy.noProviderError('withStytchSession'));
|
|
102
102
|
const { session, isInitialized, fromCache } = useStytchSession();
|
|
103
|
-
return (React__default[
|
|
103
|
+
return (React__default["default"].createElement(Component, Object.assign({}, props, { stytchSession: session, stytchSessionIsInitialized: isInitialized, stytchSessionIsFromCache: fromCache })));
|
|
104
104
|
};
|
|
105
105
|
WithStytchSession.displayName = `withStytchSession(${Component.displayName || Component.name || 'Component'})`;
|
|
106
106
|
return WithStytchSession;
|
|
@@ -141,9 +141,9 @@ const StytchProvider = ({ stytch, children }) => {
|
|
|
141
141
|
});
|
|
142
142
|
});
|
|
143
143
|
}, [setClientState, stytch]);
|
|
144
|
-
return (React__default[
|
|
145
|
-
React__default[
|
|
146
|
-
React__default[
|
|
144
|
+
return (React__default["default"].createElement(StytchContext.Provider, { value: ctx },
|
|
145
|
+
React__default["default"].createElement(StytchUserContext.Provider, { value: user },
|
|
146
|
+
React__default["default"].createElement(StytchSessionContext.Provider, { value: session }, children))));
|
|
147
147
|
};
|
|
148
148
|
|
|
149
149
|
// cc https://medium.com/@alexandereardon/uselayouteffect-and-ssr-192986cdcf7a
|
|
@@ -205,7 +205,7 @@ const StytchLogin = ({ config, styles, callbacks }) => {
|
|
|
205
205
|
styles,
|
|
206
206
|
});
|
|
207
207
|
}, [stytchClient, config, styles, callbacks]);
|
|
208
|
-
return React__default[
|
|
208
|
+
return React__default["default"].createElement("div", { ref: containerEl });
|
|
209
209
|
};
|
|
210
210
|
/**
|
|
211
211
|
* The Stytch Reset Password component.
|
|
@@ -268,7 +268,7 @@ const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken })
|
|
|
268
268
|
});
|
|
269
269
|
}
|
|
270
270
|
}, [stytchClient, config, styles, callbacks, passwordResetToken]);
|
|
271
|
-
return React__default[
|
|
271
|
+
return React__default["default"].createElement("div", { ref: containerEl });
|
|
272
272
|
};
|
|
273
273
|
/**
|
|
274
274
|
* The Stytch Passkey Registration component.
|
|
@@ -323,7 +323,7 @@ const StytchPasskeyRegistration = ({ config, styles, callbacks }) => {
|
|
|
323
323
|
styles,
|
|
324
324
|
});
|
|
325
325
|
}, [stytchClient, config, styles, callbacks, user]);
|
|
326
|
-
return React__default[
|
|
326
|
+
return React__default["default"].createElement("div", { ref: containerEl });
|
|
327
327
|
};
|
|
328
328
|
|
|
329
329
|
exports.StytchLogin = StytchLogin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stytch/nextjs",
|
|
3
|
-
"version": "21.1.
|
|
3
|
+
"version": "21.1.1",
|
|
4
4
|
"description": "Stytch's official Next.js Library",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -23,13 +23,13 @@
|
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@babel/runtime": "7.18.6",
|
|
25
25
|
"@stytch/js-utils": "0.0.0",
|
|
26
|
-
"@stytch/vanilla-js": "5.
|
|
26
|
+
"@stytch/vanilla-js": "5.10.2",
|
|
27
27
|
"@testing-library/react": "14.0.0",
|
|
28
28
|
"eslint-config-custom": "0.0.1",
|
|
29
29
|
"react": "18.2.0",
|
|
30
30
|
"react-dom": "18.2.0",
|
|
31
31
|
"react-test-renderer": "18.0.0",
|
|
32
|
-
"rollup": "2.
|
|
32
|
+
"rollup": "2.79.2",
|
|
33
33
|
"typescript": "5.3.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependencies": {
|
|
File without changes
|