@stytch/react 0.0.0-idp-20241212005436

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 ADDED
@@ -0,0 +1,371 @@
1
+ # @stytch/react
2
+
3
+ ## 0.0.0-idp-20241212005436
4
+
5
+ ### Minor Changes
6
+
7
+ - Add Consumer IDP Component
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies
12
+ - @stytch/vanilla-js@0.0.0-idp-20241212005436
13
+
14
+ ## 19.1.0
15
+
16
+ ### Minor Changes
17
+
18
+ - 160124c9: Add `AdminPortalSCIM` component component to `@stytch/react/b2b/adminPortal`
19
+
20
+ ## 19.0.0
21
+
22
+ ### Major Changes
23
+
24
+ - Updated API routes to use api.stytch.com for live and test.stytch.com for test, replacing web.stytch.com.
25
+ If you use Content Security Policy (CSP) headers, ensure the URL is updated.
26
+ 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.
27
+
28
+ ### Patch Changes
29
+
30
+ - Updated dependencies [3c39a997]
31
+ - @stytch/vanilla-js@5.0.0
32
+
33
+ ## 18.3.3
34
+
35
+ ### Patch Changes
36
+
37
+ - 6d06cce0: Load Admin Portal components from vanilla-js directly
38
+
39
+ ## 18.3.2
40
+
41
+ ### Patch Changes
42
+
43
+ - 7d2c2878: Fix admin portal component props
44
+
45
+ ## 18.3.1
46
+
47
+ ### Patch Changes
48
+
49
+ - 089c986a: Guard references to localStorage and sessionStorage
50
+
51
+ ## 18.3.0
52
+
53
+ ### Minor Changes
54
+
55
+ - 3183b459: Add `AdminPortalMemberManagement` component to `@stytch/react/b2b/adminPortal`
56
+
57
+ ## 18.2.0
58
+
59
+ ### Minor Changes
60
+
61
+ - 1ade8d93: Add `AdminPortalOrgSettings` component to `@stytch/react/b2b/adminPortal`
62
+
63
+ ## 18.1.0
64
+
65
+ ### Minor Changes
66
+
67
+ - a99f21b8: Add `AdminPortalSSO` component to `@stytch/react/b2b/adminPortal`
68
+
69
+ ### Patch Changes
70
+
71
+ - Updated dependencies [0f448e7e]
72
+ - Updated dependencies [a99f21b8]
73
+ - @stytch/vanilla-js@4.13.0
74
+
75
+ ## 18.0.0
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [cbab0c30]
80
+ - @stytch/vanilla-js@4.12.0
81
+
82
+ ## 17.0.0
83
+
84
+ ### Major Changes
85
+
86
+ - a0fbe9f: Update minimum peer dependency on `@stytch/vanilla-js` to `^4.9.0`
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [a0fbe9f]
91
+ - Updated dependencies [a0fbe9f]
92
+ - @stytch/vanilla-js@4.9.0
93
+
94
+ ## 16.0.0
95
+
96
+ ### Patch Changes
97
+
98
+ - Updated dependencies [f604dcb]
99
+ - @stytch/vanilla-js@4.7.0
100
+
101
+ ## 15.0.0
102
+
103
+ ### Minor Changes
104
+
105
+ - 223e30e: Add `useStytchOrganization` hook for B2B
106
+
107
+ ### Patch Changes
108
+
109
+ - Updated dependencies [223e30e]
110
+ - @stytch/vanilla-js@4.2.0
111
+
112
+ ## 14.0.1
113
+
114
+ ### Patch Changes
115
+
116
+ - e6832cb: Fix an issue where `fromCache` would not update to `false` after cached data was refreshed
117
+ - Updated dependencies [e6832cb]
118
+ - @stytch/vanilla-js@4.1.1
119
+
120
+ ## 14.0.0
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies [2379b29]
125
+ - @stytch/vanilla-js@4.1.0
126
+
127
+ ## 13.0.0
128
+
129
+ ### Minor Changes
130
+
131
+ - 6890694: Mark stytch.member as deprecated in favor of stytch.self
132
+ Adds RBAC functionality
133
+
134
+ ### Patch Changes
135
+
136
+ - Updated dependencies [9ee61b3]
137
+ - Updated dependencies [b34293a]
138
+ - Updated dependencies [c3c108b]
139
+ - Updated dependencies [6890694]
140
+ - @stytch/vanilla-js@4.0.0
141
+
142
+ ## 12.0.0
143
+
144
+ ### Patch Changes
145
+
146
+ - Updated dependencies [ec1962c]
147
+ - @stytch/vanilla-js@3.2.0
148
+
149
+ ## 11.0.0
150
+
151
+ ### Minor Changes
152
+
153
+ - 8cff174: B2C Passkeys Headless Support & UI components
154
+
155
+ ### Patch Changes
156
+
157
+ - Updated dependencies [8cff174]
158
+ - @stytch/vanilla-js@3.1.0
159
+
160
+ ## 10.0.0
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [5dd9d24]
165
+ - @stytch/vanilla-js@3.0.0
166
+
167
+ ## 9.0.0
168
+
169
+ ### Patch Changes
170
+
171
+ - 47eb388: Add Device Fingerprinting to the React Native SDK
172
+ - Updated dependencies [47eb388]
173
+ - Updated dependencies [d008ef5]
174
+ - Updated dependencies [47eb388]
175
+ - Updated dependencies [7c1940e]
176
+ - @stytch/vanilla-js@2.2.0
177
+
178
+ ## 8.0.0
179
+
180
+ ### Patch Changes
181
+
182
+ - Updated dependencies [67d42f0]
183
+ - @stytch/vanilla-js@2.1.0
184
+
185
+ ## 7.0.2
186
+
187
+ ### Patch Changes
188
+
189
+ - 1b1ea1b: updateStateAndTokens call in resetBySession and resetExistingPassword
190
+ - Updated dependencies [1b1ea1b]
191
+ - Updated dependencies [47cd46c]
192
+ - @stytch/vanilla-js@2.0.3
193
+
194
+ ## 7.0.1
195
+
196
+ ### Patch Changes
197
+
198
+ - 0a18c34: Add docs for new verified fields on Member objects, and fix some docs links
199
+ - Updated dependencies [9fd5d96]
200
+ - Updated dependencies [0a18c34]
201
+ - @stytch/vanilla-js@2.0.1
202
+
203
+ ## 7.0.0
204
+
205
+ ### Major Changes
206
+
207
+ - a4083c7: Breaking Changes: The intermediate session token (IST) will no longer be accepted as an argument for the discovery list organizations, intermediate sessions exchange, and create organization via discovery endpoints. The IST will be passed in automatically. ISTs are stored as browser cookies or persisted on device when they are generated after calls to discovery authenticate endpoints, such as email magic link discovery authenticate, or primary authenticate endpoints in the case where MFA is required, such as email magic link authenticate or SSO authenticate.
208
+
209
+ New Features: Our B2B product now supports multi-factor authentication (MFA) with one-time passcodes (OTPs) via SMS. MFA policies can be set on the Organization level or on the Member level. See the Stytch docs for more information.
210
+
211
+ ### Patch Changes
212
+
213
+ - Updated dependencies [a4083c7]
214
+ - @stytch/vanilla-js@2.0.0
215
+
216
+ ## 6.0.0
217
+
218
+ ### Patch Changes
219
+
220
+ - Updated dependencies [e7302d7]
221
+ - @stytch/vanilla-js@1.1.0
222
+
223
+ ## 5.0.0
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [f9c36c9]
228
+ - @stytch/vanilla-js@1.0.0
229
+
230
+ ## 4.0.0
231
+
232
+ ### Minor Changes
233
+
234
+ - c8e2d0b: B2B Passwords UI components
235
+
236
+ ### Patch Changes
237
+
238
+ - Updated dependencies [c8e2d0b]
239
+ - @stytch/vanilla-js@0.14.0
240
+
241
+ ## 3.0.0
242
+
243
+ ### Minor Changes
244
+
245
+ - 15dbe7d: Releasing UI components for our B2B SDKs.
246
+
247
+ ### Patch Changes
248
+
249
+ - Updated dependencies [15dbe7d]
250
+ - @stytch/vanilla-js@0.13.0
251
+
252
+ ## 2.0.0
253
+
254
+ ### Patch Changes
255
+
256
+ - 6a27584: Make organization name and slug optional for discovery organization create
257
+ - Updated dependencies [dde1f2a]
258
+ - Updated dependencies [6a27584]
259
+ - @stytch/vanilla-js@0.12.0
260
+
261
+ ## 1.0.2
262
+
263
+ ### Patch Changes
264
+
265
+ - 79ca7ba: Add locale argument to B2B email magic link methods
266
+ - Updated dependencies [79ca7ba]
267
+ - @stytch/vanilla-js@0.11.3
268
+
269
+ ## 1.0.1
270
+
271
+ ### Patch Changes
272
+
273
+ - c924765: Include the b2b directory in package.json for the B2B SDK entrypoint
274
+ - Updated dependencies [c924765]
275
+ - @stytch/vanilla-js@0.11.2
276
+
277
+ ## 1.0.0
278
+
279
+ ### Minor Changes
280
+
281
+ - c0e42bc: Add B2B Discovery headless client and session exchange method
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies [c0e42bc]
286
+ - @stytch/vanilla-js@0.11.0
287
+
288
+ ## 0.10.3
289
+
290
+ ### Patch Changes
291
+
292
+ - 1652706: Fix session/user persisting after logging out
293
+ - Updated dependencies [1652706]
294
+ - @stytch/vanilla-js@0.10.7
295
+
296
+ ## 0.10.2
297
+
298
+ ### Patch Changes
299
+
300
+ - ca5a31d: SDK-877 Fix session/user persisting after logging out
301
+ - Updated dependencies [ca5a31d]
302
+ - @stytch/vanilla-js@0.10.6
303
+
304
+ ## 0.10.1
305
+
306
+ ### Patch Changes
307
+
308
+ - f1810c4: Add React Native OAuth callback, PKCE fix
309
+ - Updated dependencies [f1810c4]
310
+ - @stytch/vanilla-js@0.10.2
311
+
312
+ ## 0.10.0
313
+
314
+ ### Minor Changes
315
+
316
+ - Launching B2B SDKs
317
+
318
+ ### Patch Changes
319
+
320
+ - Updated dependencies
321
+ - @stytch/vanilla-js@0.10.0
322
+
323
+ ## 0.9.0
324
+
325
+ ### Patch Changes
326
+
327
+ - Updated dependencies
328
+ - @stytch/vanilla-js@0.9.0
329
+
330
+ ## 0.6.0
331
+
332
+ ### Minor Changes
333
+
334
+ - Add support for template ID parameters to Magic link Login or create and Send methods, Email OTP Login or create and Send methods, and Reset Password Start
335
+
336
+ ### Patch Changes
337
+
338
+ - Updated dependencies
339
+ - Updated dependencies [ac0cf89]
340
+ - @stytch/vanilla-js@0.6.0
341
+
342
+ ## 0.5.0
343
+
344
+ ### Patch Changes
345
+
346
+ - 422c698: Add type definitions for User Metadata fields
347
+ - Updated dependencies [422c698]
348
+ - Updated dependencies
349
+ - @stytch/vanilla-js@0.5.0
350
+
351
+ ## 0.4.6
352
+
353
+ ### Patch Changes
354
+
355
+ - Add support for custom email domains in magic link confirmation screen
356
+ - Updated dependencies
357
+ - @stytch/vanilla-js@0.4.6
358
+
359
+ ## 0.4.5
360
+
361
+ ### Patch Changes
362
+
363
+ - Reset Password component doc fixes
364
+
365
+ ## 0.4.4
366
+
367
+ ### Patch Changes
368
+
369
+ - Send methods in the SDK
370
+ - Updated dependencies
371
+ - @stytch/vanilla-js@0.4.4
package/LICENSE ADDED
@@ -0,0 +1,17 @@
1
+ MIT License
2
+ Copyright (c) 2021 stytchauth
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+ The above copyright notice and this permission notice shall be included in all
10
+ copies or substantial portions of the Software.
11
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,157 @@
1
+ # @stytch/react
2
+
3
+ Stytch's React Library
4
+
5
+ ## Install
6
+
7
+ With `npm`
8
+ `npm install @stytch/react @stytch/vanilla-js --save`
9
+
10
+ ## Documentation
11
+
12
+ For full documentation please refer to Stytch's javascript SDK documentation at https://stytch.com/docs/sdks/javascript-sdk.
13
+
14
+ ## Example Usage
15
+
16
+ ```javascript
17
+ import { StytchProvider } from '@stytch/react';
18
+ import { StytchUIClient } from '@stytch/vanilla-js';
19
+
20
+ const stytch = new StytchUIClient('public-token-<find yours in the stytch dashboard>');
21
+
22
+ // Wrap your App in the StytchProvider
23
+ ReactDOM.render(
24
+ <StytchProvider stytch={stytch}>
25
+ <App />
26
+ </StytchProvider>,
27
+ document.getElementById('root'),
28
+ );
29
+
30
+ // Now use Stytch in your components
31
+ const App = () => {
32
+ const stytchProps = {
33
+ config: {
34
+ products: ['emailMagicLinks'],
35
+ emailMagicLinksOptions: {
36
+ loginRedirectURL: 'https://example.com/authenticate',
37
+ loginExpirationMinutes: 30,
38
+ signupRedirectURL: 'https://example.com/authenticate',
39
+ signupExpirationMinutes: 30,
40
+ createUserAsPending: true,
41
+ },
42
+ },
43
+ styles: {
44
+ container: { width: '321px' },
45
+ colors: { primary: '#0577CA' },
46
+ fontFamily: '"Helvetica New", Helvetica, sans-serif',
47
+ },
48
+ callbacks: {
49
+ onEvent: (message) => console.log(message),
50
+ onSuccess: (message) => console.log(message),
51
+ onError: (message) => console.log(message),
52
+ },
53
+ };
54
+
55
+ return (
56
+ <div id="login">
57
+ <StytchLogin
58
+ config={stytchProps.loginOrSignupView}
59
+ styles={stytchProps.styles}
60
+ callbacks={stytchProps.callbacks}
61
+ />
62
+ </div>
63
+ );
64
+ };
65
+ ```
66
+
67
+ ## Typescript Support
68
+
69
+ There are built in typescript definitions in the npm package.
70
+
71
+ ## Migrating from @stytch/stytch-react
72
+
73
+ If you are migrating from [@stytch/stytch-react](https://www.npmjs.com/package/@stytch/stytch-react), follow the steps below:
74
+
75
+ ### Step 1: Install the new libraries
76
+
77
+ - The core SDK is now bundled in its own module - [@stytch/vanilla-js](https://www.npmjs.com/package/@stytch/vanilla-js)
78
+ - We now have a library specifically for React bindings - [@stytch/react](https://www.npmjs.com/package/@stytch/react)
79
+
80
+ ```shell
81
+ # NPM
82
+ npm install @stytch/vanilla-js @stytch/react
83
+ # Yarn
84
+ yarn add @stytch/vanilla-js @stytch/react
85
+ ```
86
+
87
+ ### Step 2: Remove the old SDK
88
+
89
+ - Remove the `@styth/stytch-react` package
90
+ - If you are explicitly loading the `stytch.js` script in the document header, remove it. It isn't needed anymore.
91
+
92
+ ```shell
93
+ # NPM
94
+ npm rm @stytch/stytch-react
95
+ # Yarn
96
+ yarn remove @stytch/stytch-react
97
+ ```
98
+
99
+ ### Step 3: Initialize the client in your Application Root
100
+
101
+ - Determine if you need the Headless or UI client. If you plan to use the `<StytchLogin />` component in your application then you should use the the UI client. Otherwise use the Headless client to minimize application bundle size.
102
+ - To create the Stytch Headless client, use `StytchHeadlessClient` from `@stytch/vanilla-js/headless`
103
+ - To create the Stytch UI client, use `StytchUIClient` from `@stytch/vanilla-js`
104
+ - Pass it into `<StytchProvider />` component from `@stytch/react`
105
+
106
+ ```jsx
107
+ import React from 'react';
108
+ import { StytchProvider } from '@stytch/react';
109
+ import { StytchHeadlessClient } from '@stytch/vanilla-js/headless';
110
+ // Or alternately
111
+ // import { StytchUIClient } from '@stytch/vanilla-js';
112
+
113
+ const stytch = new StytchHeadlessClient(process.env.REACT_APP_STYTCH_PUBLIC_TOKEN);
114
+
115
+ function WrappedApp() {
116
+ return (
117
+ <StytchProvider stytch={stytch}>
118
+ <App />
119
+ </StytchProvider>
120
+ );
121
+ }
122
+
123
+ export default WrappedApp;
124
+ ```
125
+
126
+ ### Step 4: Update calls to `useStytchUser` , `useStytchSession`, and `useStytchLazy`
127
+
128
+ - `useStytchUser` and `useStytchSession` hooks now return envelope objects - `{ user, isCached }` and `{ session, isCached }` respectively.
129
+ - On first render the SDK will read user/session out of persistent storage, and serve them with `isCached: true` - at this point you’re reading the stale-while-revalidating value
130
+ - The SDK will make network requests to pull the most up-to-date user and session objects, and serve them with `isCached: false`
131
+ - `useStytchLazy` is no longer required - you may always call `useStytch` now
132
+
133
+ ```jsx
134
+ import React, { useEffect } from 'react';
135
+ import { useStytchUser } from '@stytch/react';
136
+
137
+ export default function Profile() {
138
+ const router = useRouter();
139
+ const { user, isCached } = useStytchUser();
140
+
141
+ return (
142
+ <Layout>
143
+ <h1>Your {isCached ? 'Cached' : null} Profile</h1>
144
+ <pre>{JSON.stringify(user, null, 2)}</pre>
145
+ </Layout>
146
+ );
147
+ }
148
+ ```
149
+
150
+ ### Step 5: UI Naming Changes
151
+
152
+ We've made a number of small changes to our naming conventions to make the API cleaner and easier to understand.
153
+
154
+ - The `<Stytch />` login component is now called `<StytchLogin />`
155
+ - The `OAuthProvidersTypes` enum is now called `OAuthProviders`
156
+ - The `SDKProductTypes` enum is now called `Products`
157
+ - There are some additional changes to the `styles` config documented [here](https://stytch.com/docs/sdks/javascript-sdk#resources_migration-guide_v-zero-five)
@@ -0,0 +1,6 @@
1
+ {
2
+ "internal": true,
3
+ "main": "../../dist/adminPortal/index.js",
4
+ "module": "../../dist/adminPortal/index.esm.js",
5
+ "types": "../../dist/adminPortal/index.d.ts"
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "internal": true,
3
+ "main": "../dist/b2b/index.js",
4
+ "module": "../dist/b2b/index.esm.js",
5
+ "types": "../dist/b2b/index.d.ts"
6
+ }