@stytch/react 0.3.3 → 0.4.5
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 +15 -0
- package/dist/index.d.ts +26 -1
- package/dist/index.esm.d.ts +26 -1
- package/dist/index.esm.js +26 -1
- package/dist/index.js +34 -9
- package/package.json +6 -6
package/CHANGELOG.md
ADDED
package/dist/index.d.ts
CHANGED
|
@@ -113,7 +113,32 @@ interface StytchResetPasswordProps extends StytchProps {
|
|
|
113
113
|
* and {@link https://storybook.stytch.com interactive examples} for more.
|
|
114
114
|
*
|
|
115
115
|
* @example
|
|
116
|
-
*
|
|
116
|
+
* <StytchPasswordReset
|
|
117
|
+
* config={{
|
|
118
|
+
* products: ['emailMagicLinks', 'oauth'],
|
|
119
|
+
* emailMagicLinksOptions: {
|
|
120
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
121
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
122
|
+
* },
|
|
123
|
+
* oauthOptions: {
|
|
124
|
+
* providers: [{ type: OAuthProviders.Google }, { type: OAuthProviders.Microsoft }],
|
|
125
|
+
* },
|
|
126
|
+
* }}
|
|
127
|
+
* passwordResetToken="PvC5UudZ7TPZbELt95yXAQ-8MeEUCRob8bUQ-g52fIJs"
|
|
128
|
+
* styles={{
|
|
129
|
+
* fontFamily: '"Helvetica New", Helvetica, sans-serif',
|
|
130
|
+
* primaryColor: '#0577CA',
|
|
131
|
+
* width: '321px',
|
|
132
|
+
* }}
|
|
133
|
+
* callbacks={{
|
|
134
|
+
* onEvent: (event) => console.log(event)
|
|
135
|
+
* }}
|
|
136
|
+
* />
|
|
137
|
+
*
|
|
138
|
+
* @param config - A {@link StytchLoginConfig} object
|
|
139
|
+
* @param passwordResetToken - A Stytch password reset token
|
|
140
|
+
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
141
|
+
* @param callbacks - An optional {@link Callbacks} object
|
|
117
142
|
*/
|
|
118
143
|
declare const StytchPasswordReset: ({ config, styles, callbacks, passwordResetToken }: StytchResetPasswordProps) => JSX.Element;
|
|
119
144
|
/**
|
package/dist/index.esm.d.ts
CHANGED
|
@@ -113,7 +113,32 @@ interface StytchResetPasswordProps extends StytchProps {
|
|
|
113
113
|
* and {@link https://storybook.stytch.com interactive examples} for more.
|
|
114
114
|
*
|
|
115
115
|
* @example
|
|
116
|
-
*
|
|
116
|
+
* <StytchPasswordReset
|
|
117
|
+
* config={{
|
|
118
|
+
* products: ['emailMagicLinks', 'oauth'],
|
|
119
|
+
* emailMagicLinksOptions: {
|
|
120
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
121
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
122
|
+
* },
|
|
123
|
+
* oauthOptions: {
|
|
124
|
+
* providers: [{ type: OAuthProviders.Google }, { type: OAuthProviders.Microsoft }],
|
|
125
|
+
* },
|
|
126
|
+
* }}
|
|
127
|
+
* passwordResetToken="PvC5UudZ7TPZbELt95yXAQ-8MeEUCRob8bUQ-g52fIJs"
|
|
128
|
+
* styles={{
|
|
129
|
+
* fontFamily: '"Helvetica New", Helvetica, sans-serif',
|
|
130
|
+
* primaryColor: '#0577CA',
|
|
131
|
+
* width: '321px',
|
|
132
|
+
* }}
|
|
133
|
+
* callbacks={{
|
|
134
|
+
* onEvent: (event) => console.log(event)
|
|
135
|
+
* }}
|
|
136
|
+
* />
|
|
137
|
+
*
|
|
138
|
+
* @param config - A {@link StytchLoginConfig} object
|
|
139
|
+
* @param passwordResetToken - A Stytch password reset token
|
|
140
|
+
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
141
|
+
* @param callbacks - An optional {@link Callbacks} object
|
|
117
142
|
*/
|
|
118
143
|
declare const StytchPasswordReset: ({ config, styles, callbacks, passwordResetToken }: StytchResetPasswordProps) => JSX.Element;
|
|
119
144
|
/**
|
package/dist/index.esm.js
CHANGED
|
@@ -225,7 +225,32 @@ const StytchLogin = ({ config, styles, callbacks }) => {
|
|
|
225
225
|
* and {@link https://storybook.stytch.com interactive examples} for more.
|
|
226
226
|
*
|
|
227
227
|
* @example
|
|
228
|
-
*
|
|
228
|
+
* <StytchPasswordReset
|
|
229
|
+
* config={{
|
|
230
|
+
* products: ['emailMagicLinks', 'oauth'],
|
|
231
|
+
* emailMagicLinksOptions: {
|
|
232
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
233
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
234
|
+
* },
|
|
235
|
+
* oauthOptions: {
|
|
236
|
+
* providers: [{ type: OAuthProviders.Google }, { type: OAuthProviders.Microsoft }],
|
|
237
|
+
* },
|
|
238
|
+
* }}
|
|
239
|
+
* passwordResetToken="PvC5UudZ7TPZbELt95yXAQ-8MeEUCRob8bUQ-g52fIJs"
|
|
240
|
+
* styles={{
|
|
241
|
+
* fontFamily: '"Helvetica New", Helvetica, sans-serif',
|
|
242
|
+
* primaryColor: '#0577CA',
|
|
243
|
+
* width: '321px',
|
|
244
|
+
* }}
|
|
245
|
+
* callbacks={{
|
|
246
|
+
* onEvent: (event) => console.log(event)
|
|
247
|
+
* }}
|
|
248
|
+
* />
|
|
249
|
+
*
|
|
250
|
+
* @param config - A {@link StytchLoginConfig} object
|
|
251
|
+
* @param passwordResetToken - A Stytch password reset token
|
|
252
|
+
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
253
|
+
* @param callbacks - An optional {@link Callbacks} object
|
|
229
254
|
*/
|
|
230
255
|
const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken }) => {
|
|
231
256
|
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchResetPassword />'));
|
package/dist/index.js
CHANGED
|
@@ -100,7 +100,7 @@ const useStytch = () => {
|
|
|
100
100
|
const withStytch = (Component) => {
|
|
101
101
|
const WithStytch = (props) => {
|
|
102
102
|
invariant(useIsMounted__INTERNAL(), noProviderError('withStytch'));
|
|
103
|
-
return React__default[
|
|
103
|
+
return React__default['default'].createElement(Component, Object.assign({}, props, { stytch: useStytch() }));
|
|
104
104
|
};
|
|
105
105
|
WithStytch.displayName = `withStytch(${Component.displayName || Component.name || 'Component'})`;
|
|
106
106
|
return WithStytch;
|
|
@@ -109,7 +109,7 @@ const withStytchUser = (Component) => {
|
|
|
109
109
|
const WithStytchUser = (props) => {
|
|
110
110
|
invariant(useIsMounted__INTERNAL(), noProviderError('withStytchUser'));
|
|
111
111
|
const { user, fromCache } = useStytchUser();
|
|
112
|
-
return React__default[
|
|
112
|
+
return React__default['default'].createElement(Component, Object.assign({}, props, { stytchUser: user, stytchUserIsFromCache: fromCache }));
|
|
113
113
|
};
|
|
114
114
|
WithStytchUser.displayName = `withStytchUser(${Component.displayName || Component.name || 'Component'})`;
|
|
115
115
|
return WithStytchUser;
|
|
@@ -118,7 +118,7 @@ const withStytchSession = (Component) => {
|
|
|
118
118
|
const WithStytchSession = (props) => {
|
|
119
119
|
invariant(useIsMounted__INTERNAL(), noProviderError('withStytchSession'));
|
|
120
120
|
const { session, fromCache } = useStytchSession();
|
|
121
|
-
return React__default[
|
|
121
|
+
return React__default['default'].createElement(Component, Object.assign({}, props, { stytchSession: session, stytchSessionIsFromCache: fromCache }));
|
|
122
122
|
};
|
|
123
123
|
WithStytchSession.displayName = `withStytchSession(${Component.displayName || Component.name || 'Component'})`;
|
|
124
124
|
return WithStytchSession;
|
|
@@ -164,9 +164,9 @@ const StytchProvider = ({ stytch, children }) => {
|
|
|
164
164
|
}, [stytch, setUser, setSession]);
|
|
165
165
|
const finalSess = !!session.session === !!user.user ? session : initialSession;
|
|
166
166
|
const finalUser = !!session.session === !!user.user ? user : initialUser;
|
|
167
|
-
return (React__default[
|
|
168
|
-
React__default[
|
|
169
|
-
React__default[
|
|
167
|
+
return (React__default['default'].createElement(StytchContext.Provider, { value: ctx },
|
|
168
|
+
React__default['default'].createElement(StytchUserContext.Provider, { value: finalUser },
|
|
169
|
+
React__default['default'].createElement(StytchSessionContext.Provider, { value: finalSess }, children))));
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
/**
|
|
@@ -222,7 +222,7 @@ const StytchLogin = ({ config, styles, callbacks }) => {
|
|
|
222
222
|
styles,
|
|
223
223
|
});
|
|
224
224
|
}, [stytchClient, config, styles, callbacks]);
|
|
225
|
-
return React__default[
|
|
225
|
+
return React__default['default'].createElement("div", { ref: containerEl });
|
|
226
226
|
};
|
|
227
227
|
/**
|
|
228
228
|
* The Stytch Reset Password component.
|
|
@@ -233,7 +233,32 @@ const StytchLogin = ({ config, styles, callbacks }) => {
|
|
|
233
233
|
* and {@link https://storybook.stytch.com interactive examples} for more.
|
|
234
234
|
*
|
|
235
235
|
* @example
|
|
236
|
-
*
|
|
236
|
+
* <StytchPasswordReset
|
|
237
|
+
* config={{
|
|
238
|
+
* products: ['emailMagicLinks', 'oauth'],
|
|
239
|
+
* emailMagicLinksOptions: {
|
|
240
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
241
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
242
|
+
* },
|
|
243
|
+
* oauthOptions: {
|
|
244
|
+
* providers: [{ type: OAuthProviders.Google }, { type: OAuthProviders.Microsoft }],
|
|
245
|
+
* },
|
|
246
|
+
* }}
|
|
247
|
+
* passwordResetToken="PvC5UudZ7TPZbELt95yXAQ-8MeEUCRob8bUQ-g52fIJs"
|
|
248
|
+
* styles={{
|
|
249
|
+
* fontFamily: '"Helvetica New", Helvetica, sans-serif',
|
|
250
|
+
* primaryColor: '#0577CA',
|
|
251
|
+
* width: '321px',
|
|
252
|
+
* }}
|
|
253
|
+
* callbacks={{
|
|
254
|
+
* onEvent: (event) => console.log(event)
|
|
255
|
+
* }}
|
|
256
|
+
* />
|
|
257
|
+
*
|
|
258
|
+
* @param config - A {@link StytchLoginConfig} object
|
|
259
|
+
* @param passwordResetToken - A Stytch password reset token
|
|
260
|
+
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
261
|
+
* @param callbacks - An optional {@link Callbacks} object
|
|
237
262
|
*/
|
|
238
263
|
const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken }) => {
|
|
239
264
|
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchResetPassword />'));
|
|
@@ -260,7 +285,7 @@ const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken })
|
|
|
260
285
|
});
|
|
261
286
|
}
|
|
262
287
|
}, [stytchClient, config, styles, callbacks, passwordResetToken]);
|
|
263
|
-
return React__default[
|
|
288
|
+
return React__default['default'].createElement("div", { ref: containerEl });
|
|
264
289
|
};
|
|
265
290
|
|
|
266
291
|
exports.StytchLogin = StytchLogin;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stytch/react",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"description": "Stytch's official React Library",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"user"
|
|
31
31
|
],
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@babel/runtime": "
|
|
34
|
-
"@stytch/vanilla-js": "0.
|
|
33
|
+
"@babel/runtime": "7.18.6",
|
|
34
|
+
"@stytch/vanilla-js": "0.4.4",
|
|
35
35
|
"eslint-config-custom": "0.0.0",
|
|
36
|
-
"rollup": "
|
|
36
|
+
"rollup": "2.56.3",
|
|
37
37
|
"typescript": "4.7.4"
|
|
38
38
|
},
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"@stytch/vanilla-js": "^0.
|
|
40
|
+
"@stytch/vanilla-js": "^0.4.4",
|
|
41
41
|
"react": ">= 17.0.2",
|
|
42
42
|
"react-dom": ">= 17.0.2"
|
|
43
43
|
}
|
|
44
|
-
}
|
|
44
|
+
}
|