@stytch/nextjs 4.0.0 → 5.0.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 +17 -0
- package/dist/b2b/index.d.ts +106 -3
- package/dist/b2b/index.esm.d.ts +106 -3
- package/dist/b2b/index.esm.js +5040 -582
- package/dist/b2b/index.js +5039 -580
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @stytch/nextjs
|
|
2
2
|
|
|
3
|
+
## 5.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8c54ee1: Missing export in the nextjs SDK for the UI component
|
|
8
|
+
|
|
9
|
+
## 5.0.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 15dbe7d: Releasing UI components for our B2B SDKs.
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- Updated dependencies [15dbe7d]
|
|
18
|
+
- @stytch/vanilla-js@0.13.0
|
|
19
|
+
|
|
3
20
|
## 4.0.0
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/b2b/index.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
-
import { StytchB2BHeadlessClient, Member, MemberSession } from "@stytch/vanilla-js/b2b/";
|
|
4
|
+
import { StytchB2BHeadlessClient, StytchB2BUIClient, Member, MemberSession } from "@stytch/vanilla-js/b2b/";
|
|
5
|
+
import { Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/vanilla-js";
|
|
5
6
|
import { StytchB2BHeadlessClient as StytchB2BHeadlessClient$0 } from "@stytch/vanilla-js/b2b";
|
|
6
7
|
/**
|
|
7
8
|
* The Stytch Client object passed in to <StytchProvider /> in your `_app.js`.
|
|
8
9
|
* Either a StytchUIClient or StytchHeadlessClient.
|
|
9
10
|
*/
|
|
10
|
-
type StytchB2BClient = StytchB2BHeadlessClient;
|
|
11
|
+
type StytchB2BClient = StytchB2BHeadlessClient | StytchB2BUIClient;
|
|
11
12
|
type SWRMember = {
|
|
12
13
|
member: null;
|
|
13
14
|
fromCache: false;
|
|
@@ -101,6 +102,108 @@ interface StytchB2BProviderProps {
|
|
|
101
102
|
* )
|
|
102
103
|
*/
|
|
103
104
|
declare const StytchB2BProvider: ({ stytch, children }: StytchB2BProviderProps) => JSX.Element;
|
|
105
|
+
interface StytchB2BProps {
|
|
106
|
+
/**
|
|
107
|
+
* An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* {
|
|
111
|
+
* fontFamily: 'Arial, Helvetica, sans-serif',
|
|
112
|
+
* width: '360px',
|
|
113
|
+
* primaryColor: '#19303D',
|
|
114
|
+
* }
|
|
115
|
+
*/
|
|
116
|
+
styles?: StyleConfig;
|
|
117
|
+
/**
|
|
118
|
+
* An optional {@link Callbacks} object.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* {
|
|
122
|
+
* onError: ({message}) => {
|
|
123
|
+
* console.error('Stytch error', message)
|
|
124
|
+
* }
|
|
125
|
+
* }
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* {
|
|
129
|
+
* onEvent: ({type, data}) => {
|
|
130
|
+
* if(type === StytchEventType.B2BMagicLinkAuthenticate) {
|
|
131
|
+
* console.log('Logged in with', data);
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* }
|
|
135
|
+
*/
|
|
136
|
+
callbacks?: Callbacks;
|
|
137
|
+
/**
|
|
138
|
+
* A {@link StytchB2BUIConfig} object. Add products and product-specific config to this object to change the login methods shown.
|
|
139
|
+
*
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* {
|
|
143
|
+
* products: ['emailMagicLinks'],
|
|
144
|
+
* authFlowType: "Discovery",
|
|
145
|
+
* emailMagicLinksOptions: {
|
|
146
|
+
* discoveryRedirectURL: 'https://example.com/authenticate',
|
|
147
|
+
* },
|
|
148
|
+
* sessionOptions: {
|
|
149
|
+
* sessionDurationMinutes: 60,
|
|
150
|
+
* },
|
|
151
|
+
* }
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* {
|
|
155
|
+
* products: ['emailMagicLinks', 'sso'],
|
|
156
|
+
* authFlowType: "Organization",
|
|
157
|
+
* emailMagicLinksOptions: {
|
|
158
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
159
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
160
|
+
* },
|
|
161
|
+
* ssoOptions: {
|
|
162
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
163
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
164
|
+
* },
|
|
165
|
+
* sessionOptions: {
|
|
166
|
+
* sessionDurationMinutes: 60,
|
|
167
|
+
* },
|
|
168
|
+
* }
|
|
169
|
+
*/
|
|
170
|
+
config: StytchB2BUIConfig;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* The Stytch B2B UI component.
|
|
174
|
+
* This component can only be used with a {@link StytchB2BUIClient} client constructor
|
|
175
|
+
* passed into the {@link StytchB2BProvider}
|
|
176
|
+
*
|
|
177
|
+
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* <StytchB2B
|
|
181
|
+
* config={{
|
|
182
|
+
* authFlowType: "Organization",
|
|
183
|
+
* emailMagicLinksOptions: {
|
|
184
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
185
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
186
|
+
* },
|
|
187
|
+
* ssoOptions: {
|
|
188
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
189
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
190
|
+
* },
|
|
191
|
+
* sessionOptions: {
|
|
192
|
+
* sessionDurationMinutes: 60,
|
|
193
|
+
* }
|
|
194
|
+
* }}
|
|
195
|
+
* styles={{
|
|
196
|
+
* fontFamily: '"Helvetica New", Helvetica, sans-serif',
|
|
197
|
+
* primaryColor: '#0577CA',
|
|
198
|
+
* width: '321px',
|
|
199
|
+
* }}
|
|
200
|
+
* callbacks={{
|
|
201
|
+
* onEvent: (event) => console.log(event)
|
|
202
|
+
* }}
|
|
203
|
+
* />
|
|
204
|
+
* @param props {@link StytchB2BProps}
|
|
205
|
+
*/
|
|
206
|
+
declare const StytchB2B: ({ styles, callbacks, config }: StytchB2BProps) => JSX.Element;
|
|
104
207
|
/**
|
|
105
208
|
* Creates a Headless Stytch client object to call the stytch B2B APIs.
|
|
106
209
|
* The Stytch client is not available serverside.
|
|
@@ -115,5 +218,5 @@ declare const StytchB2BProvider: ({ stytch, children }: StytchB2BProviderProps)
|
|
|
115
218
|
* @returns A {@link StytchHeadlessClient}
|
|
116
219
|
*/
|
|
117
220
|
declare const createStytchB2BHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("core/dist/public").StytchClientOptions | undefined) => StytchB2BHeadlessClient$0;
|
|
118
|
-
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, withStytchB2BClient, withStytchMemberSession, withStytchMember, createStytchB2BHeadlessClient };
|
|
221
|
+
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, withStytchB2BClient, withStytchMemberSession, withStytchMember, StytchB2B, createStytchB2BHeadlessClient };
|
|
119
222
|
export type { StytchB2BProviderProps };
|
package/dist/b2b/index.esm.d.ts
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
|
-
import { StytchB2BHeadlessClient, Member, MemberSession } from "@stytch/vanilla-js/b2b/";
|
|
4
|
+
import { StytchB2BHeadlessClient, StytchB2BUIClient, Member, MemberSession } from "@stytch/vanilla-js/b2b/";
|
|
5
|
+
import { Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/vanilla-js";
|
|
5
6
|
import { StytchB2BHeadlessClient as StytchB2BHeadlessClient$0 } from "@stytch/vanilla-js/b2b";
|
|
6
7
|
/**
|
|
7
8
|
* The Stytch Client object passed in to <StytchProvider /> in your `_app.js`.
|
|
8
9
|
* Either a StytchUIClient or StytchHeadlessClient.
|
|
9
10
|
*/
|
|
10
|
-
type StytchB2BClient = StytchB2BHeadlessClient;
|
|
11
|
+
type StytchB2BClient = StytchB2BHeadlessClient | StytchB2BUIClient;
|
|
11
12
|
type SWRMember = {
|
|
12
13
|
member: null;
|
|
13
14
|
fromCache: false;
|
|
@@ -101,6 +102,108 @@ interface StytchB2BProviderProps {
|
|
|
101
102
|
* )
|
|
102
103
|
*/
|
|
103
104
|
declare const StytchB2BProvider: ({ stytch, children }: StytchB2BProviderProps) => JSX.Element;
|
|
105
|
+
interface StytchB2BProps {
|
|
106
|
+
/**
|
|
107
|
+
* An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* {
|
|
111
|
+
* fontFamily: 'Arial, Helvetica, sans-serif',
|
|
112
|
+
* width: '360px',
|
|
113
|
+
* primaryColor: '#19303D',
|
|
114
|
+
* }
|
|
115
|
+
*/
|
|
116
|
+
styles?: StyleConfig;
|
|
117
|
+
/**
|
|
118
|
+
* An optional {@link Callbacks} object.
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* {
|
|
122
|
+
* onError: ({message}) => {
|
|
123
|
+
* console.error('Stytch error', message)
|
|
124
|
+
* }
|
|
125
|
+
* }
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* {
|
|
129
|
+
* onEvent: ({type, data}) => {
|
|
130
|
+
* if(type === StytchEventType.B2BMagicLinkAuthenticate) {
|
|
131
|
+
* console.log('Logged in with', data);
|
|
132
|
+
* }
|
|
133
|
+
* }
|
|
134
|
+
* }
|
|
135
|
+
*/
|
|
136
|
+
callbacks?: Callbacks;
|
|
137
|
+
/**
|
|
138
|
+
* A {@link StytchB2BUIConfig} object. Add products and product-specific config to this object to change the login methods shown.
|
|
139
|
+
*
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* {
|
|
143
|
+
* products: ['emailMagicLinks'],
|
|
144
|
+
* authFlowType: "Discovery",
|
|
145
|
+
* emailMagicLinksOptions: {
|
|
146
|
+
* discoveryRedirectURL: 'https://example.com/authenticate',
|
|
147
|
+
* },
|
|
148
|
+
* sessionOptions: {
|
|
149
|
+
* sessionDurationMinutes: 60,
|
|
150
|
+
* },
|
|
151
|
+
* }
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* {
|
|
155
|
+
* products: ['emailMagicLinks', 'sso'],
|
|
156
|
+
* authFlowType: "Organization",
|
|
157
|
+
* emailMagicLinksOptions: {
|
|
158
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
159
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
160
|
+
* },
|
|
161
|
+
* ssoOptions: {
|
|
162
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
163
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
164
|
+
* },
|
|
165
|
+
* sessionOptions: {
|
|
166
|
+
* sessionDurationMinutes: 60,
|
|
167
|
+
* },
|
|
168
|
+
* }
|
|
169
|
+
*/
|
|
170
|
+
config: StytchB2BUIConfig;
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* The Stytch B2B UI component.
|
|
174
|
+
* This component can only be used with a {@link StytchB2BUIClient} client constructor
|
|
175
|
+
* passed into the {@link StytchB2BProvider}
|
|
176
|
+
*
|
|
177
|
+
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
178
|
+
*
|
|
179
|
+
* @example
|
|
180
|
+
* <StytchB2B
|
|
181
|
+
* config={{
|
|
182
|
+
* authFlowType: "Organization",
|
|
183
|
+
* emailMagicLinksOptions: {
|
|
184
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
185
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
186
|
+
* },
|
|
187
|
+
* ssoOptions: {
|
|
188
|
+
* loginRedirectURL: 'https://example.com/authenticate',
|
|
189
|
+
* signupRedirectURL: 'https://example.com/authenticate',
|
|
190
|
+
* },
|
|
191
|
+
* sessionOptions: {
|
|
192
|
+
* sessionDurationMinutes: 60,
|
|
193
|
+
* }
|
|
194
|
+
* }}
|
|
195
|
+
* styles={{
|
|
196
|
+
* fontFamily: '"Helvetica New", Helvetica, sans-serif',
|
|
197
|
+
* primaryColor: '#0577CA',
|
|
198
|
+
* width: '321px',
|
|
199
|
+
* }}
|
|
200
|
+
* callbacks={{
|
|
201
|
+
* onEvent: (event) => console.log(event)
|
|
202
|
+
* }}
|
|
203
|
+
* />
|
|
204
|
+
* @param props {@link StytchB2BProps}
|
|
205
|
+
*/
|
|
206
|
+
declare const StytchB2B: ({ styles, callbacks, config }: StytchB2BProps) => JSX.Element;
|
|
104
207
|
/**
|
|
105
208
|
* Creates a Headless Stytch client object to call the stytch B2B APIs.
|
|
106
209
|
* The Stytch client is not available serverside.
|
|
@@ -115,5 +218,5 @@ declare const StytchB2BProvider: ({ stytch, children }: StytchB2BProviderProps)
|
|
|
115
218
|
* @returns A {@link StytchHeadlessClient}
|
|
116
219
|
*/
|
|
117
220
|
declare const createStytchB2BHeadlessClient: (_PUBLIC_TOKEN: string, options?: import("core/dist/public").StytchClientOptions | undefined) => StytchB2BHeadlessClient$0;
|
|
118
|
-
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, withStytchB2BClient, withStytchMemberSession, withStytchMember, createStytchB2BHeadlessClient };
|
|
221
|
+
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, withStytchB2BClient, withStytchMemberSession, withStytchMember, StytchB2B, createStytchB2BHeadlessClient };
|
|
119
222
|
export type { StytchB2BProviderProps };
|