@stytch/react 19.1.1 → 19.2.0
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 +16 -0
- package/dist/{StytchB2BContext-8acafb28.d.ts → StytchB2BContext-865b6947.d.ts} +9 -9
- package/dist/{StytchB2BContext-d240104b.js → StytchB2BContext-865b6947.js} +1 -1
- package/dist/{StytchB2BContext-d240104b.d.ts → StytchB2BContext-b356bcf6.d.ts} +9 -9
- package/dist/{StytchB2BContext-8acafb28.js → StytchB2BContext-b356bcf6.js} +1 -1
- package/dist/adminPortal/index.d.ts +13 -12
- package/dist/adminPortal/index.esm.d.ts +13 -12
- package/dist/adminPortal/index.esm.js +2 -2
- package/dist/adminPortal/index.js +2 -2
- package/dist/b2b/index.d.ts +6 -6
- package/dist/b2b/index.esm.d.ts +6 -6
- package/dist/b2b/index.esm.js +4 -4
- package/dist/b2b/index.js +3 -3
- package/dist/index.d.ts +14 -15
- package/dist/index.esm.d.ts +14 -15
- package/dist/index.esm.js +4 -4
- package/dist/index.js +4 -4
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @stytch/react
|
|
2
2
|
|
|
3
|
+
## 19.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 6daadc7: Add support for TypeScript-based Stytch project configurations
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- ac0778e: Fix error message when mounting Admin Portal components without a StytchB2BProvider
|
|
12
|
+
|
|
13
|
+
## 19.1.2
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 26a2e95: Fixed <StytchB2B /> error message
|
|
18
|
+
|
|
3
19
|
## 19.1.1
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { Member, MemberSession, Organization, StytchB2BUIClient } from '@stytch/vanilla-js/b2b';
|
|
5
|
-
import { StytchB2BHeadlessClient } from '@stytch/vanilla-js/b2b/headless';
|
|
5
|
+
import { StytchB2BHeadlessClient, StytchProjectConfigurationInput } from '@stytch/vanilla-js/b2b/headless';
|
|
6
6
|
import { PermissionsMap } from '@stytch/core/public';
|
|
7
7
|
/**
|
|
8
8
|
* The Stytch Client object passed in to <StytchProvider /> in your application root.
|
|
9
9
|
*/
|
|
10
|
-
type StytchB2BClient = StytchB2BHeadlessClient | StytchB2BUIClient
|
|
10
|
+
type StytchB2BClient<TProjectConfiguration extends StytchProjectConfigurationInput> = StytchB2BHeadlessClient<TProjectConfiguration> | StytchB2BUIClient<TProjectConfiguration>;
|
|
11
11
|
type SWRMember = {
|
|
12
12
|
/**
|
|
13
13
|
* Either the active {@link Member} object, or null if the member is not logged in.
|
|
@@ -39,7 +39,7 @@ type SWROrganization = {
|
|
|
39
39
|
fromCache: boolean;
|
|
40
40
|
};
|
|
41
41
|
declare const useIsMounted__INTERNAL: () => boolean;
|
|
42
|
-
declare const isUIClient: (client: StytchB2BClient) => client is StytchB2BUIClient
|
|
42
|
+
declare const isUIClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(client: StytchB2BClient<TProjectConfiguration>) => client is StytchB2BUIClient<TProjectConfiguration>;
|
|
43
43
|
/**
|
|
44
44
|
* Returns the active Member.
|
|
45
45
|
* Check the fromCache property to determine if the member data is from persistent storage.
|
|
@@ -101,9 +101,9 @@ declare const useStytchIsAuthorized: (resourceId: string, action: string) => SWR
|
|
|
101
101
|
* stytch.magicLinks.authenticate('...')
|
|
102
102
|
* }, [stytch]);
|
|
103
103
|
*/
|
|
104
|
-
declare const useStytchB2BClient: () => StytchB2BHeadlessClient
|
|
105
|
-
declare const withStytchB2BClient: <T extends object
|
|
106
|
-
stytch: StytchB2BHeadlessClient
|
|
104
|
+
declare const useStytchB2BClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>() => StytchB2BHeadlessClient<TProjectConfiguration>;
|
|
105
|
+
declare const withStytchB2BClient: <T extends object, TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(Component: React.ComponentType<T & {
|
|
106
|
+
stytch: StytchB2BHeadlessClient<TProjectConfiguration>;
|
|
107
107
|
}>) => React.ComponentType<T>;
|
|
108
108
|
declare const withStytchMember: <T extends object>(Component: React.ComponentType<T & {
|
|
109
109
|
stytchMember: Member | null;
|
|
@@ -141,11 +141,11 @@ declare const withStytchOrganization: <T extends object>(Component: React.Compon
|
|
|
141
141
|
declare const withStytchPermissions: <Permissions_1 extends Record<string, string>, T extends object>(Component: React.ComponentType<T & {
|
|
142
142
|
stytchPermissions: PermissionsMap<Permissions_1>;
|
|
143
143
|
}>) => React.ComponentType<T>;
|
|
144
|
-
type StytchB2BProviderProps = {
|
|
144
|
+
type StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = {
|
|
145
145
|
/**
|
|
146
146
|
* A Stytch client instance {@link StytchB2BHeadlessClient}
|
|
147
147
|
*/
|
|
148
|
-
stytch: StytchB2BClient
|
|
148
|
+
stytch: StytchB2BClient<TProjectConfiguration>;
|
|
149
149
|
children?: ReactNode;
|
|
150
150
|
};
|
|
151
151
|
/**
|
|
@@ -161,5 +161,5 @@ type StytchB2BProviderProps = {
|
|
|
161
161
|
* document.getElementById('root'),
|
|
162
162
|
* )
|
|
163
163
|
*/
|
|
164
|
-
declare const StytchB2BProvider: ({ stytch, children }: StytchB2BProviderProps) => JSX.Element;
|
|
164
|
+
declare const StytchB2BProvider: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ stytch, children, }: StytchB2BProviderProps<TProjectConfiguration>) => JSX.Element;
|
|
165
165
|
export { useIsMounted__INTERNAL, isUIClient, useStytchMember, useStytchMemberSession, useStytchOrganization, useStytchIsAuthorized, useStytchB2BClient, withStytchB2BClient, withStytchMember, withStytchMemberSession, withStytchOrganization, withStytchPermissions, StytchB2BProviderProps, StytchB2BProvider };
|
|
@@ -195,7 +195,7 @@ const withStytchPermissions = (Component) => {
|
|
|
195
195
|
* document.getElementById('root'),
|
|
196
196
|
* )
|
|
197
197
|
*/
|
|
198
|
-
const StytchB2BProvider = ({ stytch, children }) => {
|
|
198
|
+
const StytchB2BProvider = ({ stytch, children, }) => {
|
|
199
199
|
invariant.invariant(!useIsMounted__INTERNAL(), invariant.B2BProviderMustBeUniqueError);
|
|
200
200
|
invariant.invariant(typeof window !== 'undefined', invariant.noSSRError);
|
|
201
201
|
const ctx = React.useMemo(() => ({ client: stytch, isMounted: true }), [stytch]);
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { Member, MemberSession, Organization, StytchB2BUIClient } from '@stytch/vanilla-js/b2b';
|
|
5
|
-
import { StytchB2BHeadlessClient } from '@stytch/vanilla-js/b2b/headless';
|
|
5
|
+
import { StytchB2BHeadlessClient, StytchProjectConfigurationInput } from '@stytch/vanilla-js/b2b/headless';
|
|
6
6
|
import { PermissionsMap } from '@stytch/core/public';
|
|
7
7
|
/**
|
|
8
8
|
* The Stytch Client object passed in to <StytchProvider /> in your application root.
|
|
9
9
|
*/
|
|
10
|
-
type StytchB2BClient = StytchB2BHeadlessClient | StytchB2BUIClient
|
|
10
|
+
type StytchB2BClient<TProjectConfiguration extends StytchProjectConfigurationInput> = StytchB2BHeadlessClient<TProjectConfiguration> | StytchB2BUIClient<TProjectConfiguration>;
|
|
11
11
|
type SWRMember = {
|
|
12
12
|
/**
|
|
13
13
|
* Either the active {@link Member} object, or null if the member is not logged in.
|
|
@@ -39,7 +39,7 @@ type SWROrganization = {
|
|
|
39
39
|
fromCache: boolean;
|
|
40
40
|
};
|
|
41
41
|
declare const useIsMounted__INTERNAL: () => boolean;
|
|
42
|
-
declare const isUIClient: (client: StytchB2BClient) => client is StytchB2BUIClient
|
|
42
|
+
declare const isUIClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(client: StytchB2BClient<TProjectConfiguration>) => client is StytchB2BUIClient<TProjectConfiguration>;
|
|
43
43
|
/**
|
|
44
44
|
* Returns the active Member.
|
|
45
45
|
* Check the fromCache property to determine if the member data is from persistent storage.
|
|
@@ -101,9 +101,9 @@ declare const useStytchIsAuthorized: (resourceId: string, action: string) => SWR
|
|
|
101
101
|
* stytch.magicLinks.authenticate('...')
|
|
102
102
|
* }, [stytch]);
|
|
103
103
|
*/
|
|
104
|
-
declare const useStytchB2BClient: () => StytchB2BHeadlessClient
|
|
105
|
-
declare const withStytchB2BClient: <T extends object
|
|
106
|
-
stytch: StytchB2BHeadlessClient
|
|
104
|
+
declare const useStytchB2BClient: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>() => StytchB2BHeadlessClient<TProjectConfiguration>;
|
|
105
|
+
declare const withStytchB2BClient: <T extends object, TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration>>(Component: React.ComponentType<T & {
|
|
106
|
+
stytch: StytchB2BHeadlessClient<TProjectConfiguration>;
|
|
107
107
|
}>) => React.ComponentType<T>;
|
|
108
108
|
declare const withStytchMember: <T extends object>(Component: React.ComponentType<T & {
|
|
109
109
|
stytchMember: Member | null;
|
|
@@ -141,11 +141,11 @@ declare const withStytchOrganization: <T extends object>(Component: React.Compon
|
|
|
141
141
|
declare const withStytchPermissions: <Permissions_1 extends Record<string, string>, T extends object>(Component: React.ComponentType<T & {
|
|
142
142
|
stytchPermissions: PermissionsMap<Permissions_1>;
|
|
143
143
|
}>) => React.ComponentType<T>;
|
|
144
|
-
type StytchB2BProviderProps = {
|
|
144
|
+
type StytchB2BProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = {
|
|
145
145
|
/**
|
|
146
146
|
* A Stytch client instance {@link StytchB2BHeadlessClient}
|
|
147
147
|
*/
|
|
148
|
-
stytch: StytchB2BClient
|
|
148
|
+
stytch: StytchB2BClient<TProjectConfiguration>;
|
|
149
149
|
children?: ReactNode;
|
|
150
150
|
};
|
|
151
151
|
/**
|
|
@@ -161,5 +161,5 @@ type StytchB2BProviderProps = {
|
|
|
161
161
|
* document.getElementById('root'),
|
|
162
162
|
* )
|
|
163
163
|
*/
|
|
164
|
-
declare const StytchB2BProvider: ({ stytch, children }: StytchB2BProviderProps) => JSX.Element;
|
|
164
|
+
declare const StytchB2BProvider: <TProjectConfiguration extends Partial<import("@stytch/core/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ stytch, children, }: StytchB2BProviderProps<TProjectConfiguration>) => JSX.Element;
|
|
165
165
|
export { useIsMounted__INTERNAL, isUIClient, useStytchMember, useStytchMemberSession, useStytchOrganization, useStytchIsAuthorized, useStytchB2BClient, withStytchB2BClient, withStytchMember, withStytchMemberSession, withStytchOrganization, withStytchPermissions, StytchB2BProviderProps, StytchB2BProvider };
|
|
@@ -189,7 +189,7 @@ const withStytchPermissions = (Component) => {
|
|
|
189
189
|
* document.getElementById('root'),
|
|
190
190
|
* )
|
|
191
191
|
*/
|
|
192
|
-
const StytchB2BProvider = ({ stytch, children }) => {
|
|
192
|
+
const StytchB2BProvider = ({ stytch, children, }) => {
|
|
193
193
|
invariant(!useIsMounted__INTERNAL(), B2BProviderMustBeUniqueError);
|
|
194
194
|
invariant(typeof window !== 'undefined', noSSRError);
|
|
195
195
|
const ctx = useMemo(() => ({ client: stytch, isMounted: true }), [stytch]);
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AdminPortalSSOMountOptions, AdminPortalOrgSettingsMountOptions, AdminPortalMemberManagementMountOptions, AdminPortalSCIMMountOptions } from "@stytch/vanilla-js/b2b/adminPortal";
|
|
3
|
-
import { StytchB2BHeadlessClient } from "@stytch/vanilla-js/b2b/headless";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { StytchB2BHeadlessClient, StytchProjectConfigurationInput } from "@stytch/vanilla-js/b2b/headless";
|
|
4
|
+
import { StytchProjectConfigurationInput as StytchProjectConfigurationInput$0 } from "@stytch/vanilla-js";
|
|
5
|
+
interface InjectedOptions<TProjectConfiguration extends StytchProjectConfigurationInput> {
|
|
6
|
+
client: StytchB2BHeadlessClient<TProjectConfiguration>;
|
|
6
7
|
element: HTMLElement;
|
|
7
8
|
}
|
|
8
|
-
type ExcludeInjectedOptions<T> = Omit<T, keyof InjectedOptions
|
|
9
|
-
type AdminPortalSSOProps = ExcludeInjectedOptions<AdminPortalSSOMountOptions
|
|
9
|
+
type ExcludeInjectedOptions<T> = Omit<T, keyof InjectedOptions<StytchProjectConfigurationInput>>;
|
|
10
|
+
type AdminPortalSSOProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalSSOMountOptions<TProjectConfiguration>>;
|
|
10
11
|
/**
|
|
11
12
|
* The Admin Portal SSO UI component.
|
|
12
13
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
13
14
|
*
|
|
14
15
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
15
16
|
*/
|
|
16
|
-
declare const AdminPortalSSO: (props: ExcludeInjectedOptions<AdminPortalSSOMountOptions
|
|
17
|
-
type AdminPortalOrgSettingsProps = ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions
|
|
17
|
+
declare const AdminPortalSSO: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalSSOMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
18
|
+
type AdminPortalOrgSettingsProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions<TProjectConfiguration>>;
|
|
18
19
|
/**
|
|
19
20
|
* The Admin Portal Organization Settings UI component.
|
|
20
21
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
21
22
|
*
|
|
22
23
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
23
24
|
*/
|
|
24
|
-
declare const AdminPortalOrgSettings: (props: ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions
|
|
25
|
-
type AdminPortalMemberManagementProps = ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions
|
|
25
|
+
declare const AdminPortalOrgSettings: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
26
|
+
type AdminPortalMemberManagementProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions<TProjectConfiguration>>;
|
|
26
27
|
/**
|
|
27
28
|
* The Admin Portal member management UI component.
|
|
28
29
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
29
30
|
*
|
|
30
31
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
31
32
|
*/
|
|
32
|
-
declare const AdminPortalMemberManagement: (props: ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions
|
|
33
|
-
type AdminPortalSCIMProps = ExcludeInjectedOptions<AdminPortalSCIMMountOptions
|
|
33
|
+
declare const AdminPortalMemberManagement: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
34
|
+
type AdminPortalSCIMProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalSCIMMountOptions<TProjectConfiguration>>;
|
|
34
35
|
/**
|
|
35
36
|
* The Admin Portal SCIM UI component.
|
|
36
37
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
37
38
|
*
|
|
38
39
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
39
40
|
*/
|
|
40
|
-
declare const AdminPortalSCIM: (props: ExcludeInjectedOptions<AdminPortalSCIMMountOptions
|
|
41
|
+
declare const AdminPortalSCIM: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalSCIMMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
41
42
|
export { AdminPortalSSO, AdminPortalOrgSettings, AdminPortalMemberManagement, AdminPortalSCIM };
|
|
42
43
|
export { AdminPortalB2BProducts } from "@stytch/vanilla-js/b2b/adminPortal";
|
|
43
44
|
export type { AdminPortalSSOProps, AdminPortalOrgSettingsProps, AdminPortalMemberManagementProps, AdminPortalSCIMProps };
|
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AdminPortalSSOMountOptions, AdminPortalOrgSettingsMountOptions, AdminPortalMemberManagementMountOptions, AdminPortalSCIMMountOptions } from "@stytch/vanilla-js/b2b/adminPortal";
|
|
3
|
-
import { StytchB2BHeadlessClient } from "@stytch/vanilla-js/b2b/headless";
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
import { StytchB2BHeadlessClient, StytchProjectConfigurationInput } from "@stytch/vanilla-js/b2b/headless";
|
|
4
|
+
import { StytchProjectConfigurationInput as StytchProjectConfigurationInput$0 } from "@stytch/vanilla-js";
|
|
5
|
+
interface InjectedOptions<TProjectConfiguration extends StytchProjectConfigurationInput> {
|
|
6
|
+
client: StytchB2BHeadlessClient<TProjectConfiguration>;
|
|
6
7
|
element: HTMLElement;
|
|
7
8
|
}
|
|
8
|
-
type ExcludeInjectedOptions<T> = Omit<T, keyof InjectedOptions
|
|
9
|
-
type AdminPortalSSOProps = ExcludeInjectedOptions<AdminPortalSSOMountOptions
|
|
9
|
+
type ExcludeInjectedOptions<T> = Omit<T, keyof InjectedOptions<StytchProjectConfigurationInput>>;
|
|
10
|
+
type AdminPortalSSOProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalSSOMountOptions<TProjectConfiguration>>;
|
|
10
11
|
/**
|
|
11
12
|
* The Admin Portal SSO UI component.
|
|
12
13
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
13
14
|
*
|
|
14
15
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
15
16
|
*/
|
|
16
|
-
declare const AdminPortalSSO: (props: ExcludeInjectedOptions<AdminPortalSSOMountOptions
|
|
17
|
-
type AdminPortalOrgSettingsProps = ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions
|
|
17
|
+
declare const AdminPortalSSO: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalSSOMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
18
|
+
type AdminPortalOrgSettingsProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions<TProjectConfiguration>>;
|
|
18
19
|
/**
|
|
19
20
|
* The Admin Portal Organization Settings UI component.
|
|
20
21
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
21
22
|
*
|
|
22
23
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
23
24
|
*/
|
|
24
|
-
declare const AdminPortalOrgSettings: (props: ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions
|
|
25
|
-
type AdminPortalMemberManagementProps = ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions
|
|
25
|
+
declare const AdminPortalOrgSettings: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalOrgSettingsMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
26
|
+
type AdminPortalMemberManagementProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions<TProjectConfiguration>>;
|
|
26
27
|
/**
|
|
27
28
|
* The Admin Portal member management UI component.
|
|
28
29
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
29
30
|
*
|
|
30
31
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
31
32
|
*/
|
|
32
|
-
declare const AdminPortalMemberManagement: (props: ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions
|
|
33
|
-
type AdminPortalSCIMProps = ExcludeInjectedOptions<AdminPortalSCIMMountOptions
|
|
33
|
+
declare const AdminPortalMemberManagement: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalMemberManagementMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
34
|
+
type AdminPortalSCIMProps<TProjectConfiguration extends StytchProjectConfigurationInput$0 = Stytch.DefaultProjectConfiguration> = ExcludeInjectedOptions<AdminPortalSCIMMountOptions<TProjectConfiguration>>;
|
|
34
35
|
/**
|
|
35
36
|
* The Admin Portal SCIM UI component.
|
|
36
37
|
* This component must be rendered within a {@link StytchB2BProvider}.
|
|
37
38
|
*
|
|
38
39
|
* See the {@link https://stytch.com/docs/b2b/sdks/javascript-sdk online reference}
|
|
39
40
|
*/
|
|
40
|
-
declare const AdminPortalSCIM: (props: ExcludeInjectedOptions<AdminPortalSCIMMountOptions
|
|
41
|
+
declare const AdminPortalSCIM: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(props: ExcludeInjectedOptions<AdminPortalSCIMMountOptions<Partial<import("core/dist/public").StytchProjectConfiguration>>>) => JSX.Element;
|
|
41
42
|
export { AdminPortalSSO, AdminPortalOrgSettings, AdminPortalMemberManagement, AdminPortalSCIM };
|
|
42
43
|
export { AdminPortalB2BProducts } from "@stytch/vanilla-js/b2b/adminPortal";
|
|
43
44
|
export type { AdminPortalSSOProps, AdminPortalOrgSettingsProps, AdminPortalMemberManagementProps, AdminPortalSCIMProps };
|
|
@@ -1,12 +1,12 @@
|
|
|
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, useLayoutEffect } from 'react';
|
|
4
|
-
import { u as useIsMounted__INTERNAL, a as useStytchB2BClient } from '../StytchB2BContext-
|
|
4
|
+
import { u as useIsMounted__INTERNAL, a as useStytchB2BClient } from '../StytchB2BContext-b356bcf6.js';
|
|
5
5
|
import { i as invariant, n as noProviderError } from '../invariant-568a7633.js';
|
|
6
6
|
|
|
7
7
|
const makeAdminPortalComponent = (mountFn, componentName) => {
|
|
8
8
|
const Component = (props) => {
|
|
9
|
-
invariant(useIsMounted__INTERNAL(), noProviderError(`<${componentName}
|
|
9
|
+
invariant(useIsMounted__INTERNAL(), noProviderError(`<${componentName} />`, 'StytchB2BProvider'));
|
|
10
10
|
const stytchClient = useStytchB2BClient();
|
|
11
11
|
const containerEl = useRef(null);
|
|
12
12
|
useLayoutEffect(() => {
|
|
@@ -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-865b6947.js');
|
|
8
8
|
var invariant = require('../invariant-ae5a5bce.js');
|
|
9
9
|
|
|
10
10
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
@@ -13,7 +13,7 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
13
13
|
|
|
14
14
|
const makeAdminPortalComponent = (mountFn, componentName) => {
|
|
15
15
|
const Component = (props) => {
|
|
16
|
-
invariant.invariant(StytchB2BContext.useIsMounted__INTERNAL(), invariant.noProviderError(`<${componentName}
|
|
16
|
+
invariant.invariant(StytchB2BContext.useIsMounted__INTERNAL(), invariant.noProviderError(`<${componentName} />`, 'StytchB2BProvider'));
|
|
17
17
|
const stytchClient = StytchB2BContext.useStytchB2BClient();
|
|
18
18
|
const containerEl = React.useRef(null);
|
|
19
19
|
React.useLayoutEffect(() => {
|
package/dist/b2b/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/vanilla-js";
|
|
4
|
-
interface StytchB2BProps {
|
|
3
|
+
import { Callbacks, StyleConfig, StytchB2BUIConfig, StytchProjectConfigurationInput } from "@stytch/vanilla-js";
|
|
4
|
+
interface StytchB2BProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> {
|
|
5
5
|
/**
|
|
6
6
|
* An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
7
7
|
*
|
|
@@ -32,7 +32,7 @@ interface StytchB2BProps {
|
|
|
32
32
|
* }
|
|
33
33
|
* }
|
|
34
34
|
*/
|
|
35
|
-
callbacks?: Callbacks
|
|
35
|
+
callbacks?: Callbacks<TProjectConfiguration>;
|
|
36
36
|
/**
|
|
37
37
|
* A {@link StytchB2BUIConfig} object. Add products and product-specific config to this object to change the login methods shown.
|
|
38
38
|
*
|
|
@@ -102,7 +102,7 @@ interface StytchB2BProps {
|
|
|
102
102
|
* />
|
|
103
103
|
* @param props {@link StytchB2BProps}
|
|
104
104
|
*/
|
|
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-
|
|
105
|
+
declare const StytchB2B: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration>>({ styles, callbacks, config }: StytchB2BProps<TProjectConfiguration>) => React.JSX.Element;
|
|
106
|
+
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-865b6947.js";
|
|
107
107
|
export { StytchB2B };
|
|
108
|
-
export type { StytchB2BProviderProps } from "../StytchB2BContext-
|
|
108
|
+
export type { StytchB2BProviderProps } from "../StytchB2BContext-865b6947.js";
|
package/dist/b2b/index.esm.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import React from "react";
|
|
3
|
-
import { Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/vanilla-js";
|
|
4
|
-
interface StytchB2BProps {
|
|
3
|
+
import { Callbacks, StyleConfig, StytchB2BUIConfig, StytchProjectConfigurationInput } from "@stytch/vanilla-js";
|
|
4
|
+
interface StytchB2BProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> {
|
|
5
5
|
/**
|
|
6
6
|
* An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
7
7
|
*
|
|
@@ -32,7 +32,7 @@ interface StytchB2BProps {
|
|
|
32
32
|
* }
|
|
33
33
|
* }
|
|
34
34
|
*/
|
|
35
|
-
callbacks?: Callbacks
|
|
35
|
+
callbacks?: Callbacks<TProjectConfiguration>;
|
|
36
36
|
/**
|
|
37
37
|
* A {@link StytchB2BUIConfig} object. Add products and product-specific config to this object to change the login methods shown.
|
|
38
38
|
*
|
|
@@ -102,7 +102,7 @@ interface StytchB2BProps {
|
|
|
102
102
|
* />
|
|
103
103
|
* @param props {@link StytchB2BProps}
|
|
104
104
|
*/
|
|
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-
|
|
105
|
+
declare const StytchB2B: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration>>({ styles, callbacks, config }: StytchB2BProps<TProjectConfiguration>) => React.JSX.Element;
|
|
106
|
+
export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-b356bcf6.js";
|
|
107
107
|
export { StytchB2B };
|
|
108
|
-
export type { StytchB2BProviderProps } from "../StytchB2BContext-
|
|
108
|
+
export type { StytchB2BProviderProps } from "../StytchB2BContext-b356bcf6.js";
|
package/dist/b2b/index.esm.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { u as useIsMounted__INTERNAL, a as useStytchB2BClient, i as isUIClient } from '../StytchB2BContext-
|
|
2
|
-
export { S as StytchB2BProvider, a as useStytchB2BClient, d as useStytchIsAuthorized, c as useStytchMember, b as useStytchMemberSession, e as useStytchOrganization, w as withStytchB2BClient, g as withStytchMember, f as withStytchMemberSession, h as withStytchOrganization, j as withStytchPermissions } from '../StytchB2BContext-
|
|
1
|
+
import { u as useIsMounted__INTERNAL, a as useStytchB2BClient, i as isUIClient } from '../StytchB2BContext-b356bcf6.js';
|
|
2
|
+
export { S as StytchB2BProvider, a as useStytchB2BClient, d as useStytchIsAuthorized, c as useStytchMember, b as useStytchMemberSession, e as useStytchOrganization, w as withStytchB2BClient, g as withStytchMember, f as withStytchMemberSession, h as withStytchOrganization, j as withStytchPermissions } from '../StytchB2BContext-b356bcf6.js';
|
|
3
3
|
import React, { useRef, useLayoutEffect } from 'react';
|
|
4
4
|
import { i as invariant, b as noHeadlessClientError, n as noProviderError } from '../invariant-568a7633.js';
|
|
5
5
|
|
|
@@ -37,8 +37,8 @@ import { i as invariant, b as noHeadlessClientError, n as noProviderError } from
|
|
|
37
37
|
* />
|
|
38
38
|
* @param props {@link StytchB2BProps}
|
|
39
39
|
*/
|
|
40
|
-
const StytchB2B = ({ styles, callbacks, config }) => {
|
|
41
|
-
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchB2B />'));
|
|
40
|
+
const StytchB2B = ({ styles, callbacks, config, }) => {
|
|
41
|
+
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchB2B />', 'StytchB2BProvider'));
|
|
42
42
|
const stytchClient = useStytchB2BClient();
|
|
43
43
|
const containerEl = useRef(null);
|
|
44
44
|
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-865b6947.js');
|
|
6
6
|
var React = require('react');
|
|
7
7
|
var invariant = require('../invariant-ae5a5bce.js');
|
|
8
8
|
|
|
@@ -44,8 +44,8 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
|
44
44
|
* />
|
|
45
45
|
* @param props {@link StytchB2BProps}
|
|
46
46
|
*/
|
|
47
|
-
const StytchB2B = ({ styles, callbacks, config }) => {
|
|
48
|
-
invariant.invariant(StytchB2BContext.useIsMounted__INTERNAL(), invariant.noProviderError('<StytchB2B />'));
|
|
47
|
+
const StytchB2B = ({ styles, callbacks, config, }) => {
|
|
48
|
+
invariant.invariant(StytchB2BContext.useIsMounted__INTERNAL(), invariant.noProviderError('<StytchB2B />', 'StytchB2BProvider'));
|
|
49
49
|
const stytchClient = StytchB2BContext.useStytchB2BClient();
|
|
50
50
|
const containerEl = React.useRef(null);
|
|
51
51
|
React.useLayoutEffect(() => {
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
// We need to import the StytchUIClient type to give the TSDoc parser a hint as to where it is from
|
|
5
|
-
|
|
6
|
-
import { Callbacks, StytchLoginConfig, StyleConfig, Session, StytchUIClient, User } from "@stytch/vanilla-js";
|
|
5
|
+
import { Callbacks, StytchLoginConfig, StyleConfig, StytchProjectConfigurationInput, Session, StytchUIClient, User } from "@stytch/vanilla-js";
|
|
7
6
|
import { StytchHeadlessClient } from "@stytch/vanilla-js/headless";
|
|
8
|
-
interface StytchProps {
|
|
7
|
+
interface StytchProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> {
|
|
9
8
|
/**
|
|
10
9
|
* A {@link StytchLoginConfig} object. Add products and product-specific config to this object to change the login methods shown.
|
|
11
10
|
*
|
|
@@ -67,7 +66,7 @@ interface StytchProps {
|
|
|
67
66
|
* }
|
|
68
67
|
* }
|
|
69
68
|
*/
|
|
70
|
-
callbacks?: Callbacks
|
|
69
|
+
callbacks?: Callbacks<TProjectConfiguration>;
|
|
71
70
|
}
|
|
72
71
|
/**
|
|
73
72
|
* The Stytch Login Screen component.
|
|
@@ -100,8 +99,8 @@ interface StytchProps {
|
|
|
100
99
|
* />
|
|
101
100
|
* @param props {@link StytchProps}
|
|
102
101
|
*/
|
|
103
|
-
declare const StytchLogin: ({ config, styles, callbacks }: StytchProps) => React.JSX.Element;
|
|
104
|
-
interface StytchResetPasswordProps extends StytchProps {
|
|
102
|
+
declare const StytchLogin: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ config, styles, callbacks }: StytchProps<TProjectConfiguration>) => React.JSX.Element;
|
|
103
|
+
interface StytchResetPasswordProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> extends StytchProps<TProjectConfiguration> {
|
|
105
104
|
passwordResetToken: string;
|
|
106
105
|
}
|
|
107
106
|
/**
|
|
@@ -140,13 +139,13 @@ interface StytchResetPasswordProps extends StytchProps {
|
|
|
140
139
|
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
141
140
|
* @param callbacks - An optional {@link Callbacks} object
|
|
142
141
|
*/
|
|
143
|
-
declare const StytchPasswordReset: ({ config, styles, callbacks, passwordResetToken }: StytchResetPasswordProps) => React.JSX.Element;
|
|
144
|
-
declare const StytchPasskeyRegistration: ({ config, styles, callbacks }: StytchProps) => React.JSX.Element;
|
|
142
|
+
declare const StytchPasswordReset: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ config, styles, callbacks, passwordResetToken }: StytchResetPasswordProps<TProjectConfiguration>) => React.JSX.Element;
|
|
143
|
+
declare const StytchPasskeyRegistration: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ config, styles, callbacks }: StytchProps<TProjectConfiguration>) => React.JSX.Element;
|
|
145
144
|
/**
|
|
146
145
|
* The Stytch Client object passed in to <StytchProvider /> in your application root.
|
|
147
146
|
* Either a StytchUIClient or StytchHeadlessClient.
|
|
148
147
|
*/
|
|
149
|
-
type StytchClient = StytchUIClient | StytchHeadlessClient
|
|
148
|
+
type StytchClient<TProjectConfiguration extends StytchProjectConfigurationInput> = StytchUIClient<TProjectConfiguration> | StytchHeadlessClient<TProjectConfiguration>;
|
|
150
149
|
type SWRUser = {
|
|
151
150
|
/**
|
|
152
151
|
* Either the active {@link User} object, or null if the user is not logged in.
|
|
@@ -197,9 +196,9 @@ declare const useStytchSession: () => SWRSession;
|
|
|
197
196
|
* stytch.magicLinks.authenticate('...')
|
|
198
197
|
* }, [stytch]);
|
|
199
198
|
*/
|
|
200
|
-
declare const useStytch: () => StytchClient
|
|
201
|
-
declare const withStytch: <T extends object>(Component: React.ComponentType<T & {
|
|
202
|
-
stytch: StytchClient
|
|
199
|
+
declare const useStytch: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>() => StytchClient<TProjectConfiguration>;
|
|
200
|
+
declare const withStytch: <T extends object, TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(Component: React.ComponentType<T & {
|
|
201
|
+
stytch: StytchClient<TProjectConfiguration>;
|
|
203
202
|
}>) => React.ComponentType<T>;
|
|
204
203
|
declare const withStytchUser: <T extends object>(Component: React.ComponentType<T & {
|
|
205
204
|
stytchUser: User | null;
|
|
@@ -209,11 +208,11 @@ declare const withStytchSession: <T extends object>(Component: React.ComponentTy
|
|
|
209
208
|
stytchSession: Session | null;
|
|
210
209
|
stytchSessionIsFromCache: boolean;
|
|
211
210
|
}>) => React.ComponentType<T>;
|
|
212
|
-
type StytchProviderProps = {
|
|
211
|
+
type StytchProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = {
|
|
213
212
|
/**
|
|
214
213
|
* A Stytch client instance, either a {@link StytchUIClient} or {@link StytchHeadlessClient}
|
|
215
214
|
*/
|
|
216
|
-
stytch: StytchClient
|
|
215
|
+
stytch: StytchClient<TProjectConfiguration>;
|
|
217
216
|
children?: ReactNode;
|
|
218
217
|
};
|
|
219
218
|
/**
|
|
@@ -229,6 +228,6 @@ type StytchProviderProps = {
|
|
|
229
228
|
* document.getElementById('root'),
|
|
230
229
|
* )
|
|
231
230
|
*/
|
|
232
|
-
declare const StytchProvider: ({ stytch, children }: StytchProviderProps) => JSX.Element;
|
|
231
|
+
declare const StytchProvider: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ stytch, children }: StytchProviderProps<TProjectConfiguration>) => JSX.Element;
|
|
233
232
|
export { StytchLogin, StytchPasswordReset, StytchPasskeyRegistration, StytchProvider, useStytch, useStytchSession, useStytchUser, withStytch, withStytchSession, withStytchUser };
|
|
234
233
|
export type { StytchProviderProps };
|
package/dist/index.esm.d.ts
CHANGED
|
@@ -2,10 +2,9 @@
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
// We need to import the StytchUIClient type to give the TSDoc parser a hint as to where it is from
|
|
5
|
-
|
|
6
|
-
import { Callbacks, StytchLoginConfig, StyleConfig, Session, StytchUIClient, User } from "@stytch/vanilla-js";
|
|
5
|
+
import { Callbacks, StytchLoginConfig, StyleConfig, StytchProjectConfigurationInput, Session, StytchUIClient, User } from "@stytch/vanilla-js";
|
|
7
6
|
import { StytchHeadlessClient } from "@stytch/vanilla-js/headless";
|
|
8
|
-
interface StytchProps {
|
|
7
|
+
interface StytchProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> {
|
|
9
8
|
/**
|
|
10
9
|
* A {@link StytchLoginConfig} object. Add products and product-specific config to this object to change the login methods shown.
|
|
11
10
|
*
|
|
@@ -67,7 +66,7 @@ interface StytchProps {
|
|
|
67
66
|
* }
|
|
68
67
|
* }
|
|
69
68
|
*/
|
|
70
|
-
callbacks?: Callbacks
|
|
69
|
+
callbacks?: Callbacks<TProjectConfiguration>;
|
|
71
70
|
}
|
|
72
71
|
/**
|
|
73
72
|
* The Stytch Login Screen component.
|
|
@@ -100,8 +99,8 @@ interface StytchProps {
|
|
|
100
99
|
* />
|
|
101
100
|
* @param props {@link StytchProps}
|
|
102
101
|
*/
|
|
103
|
-
declare const StytchLogin: ({ config, styles, callbacks }: StytchProps) => React.JSX.Element;
|
|
104
|
-
interface StytchResetPasswordProps extends StytchProps {
|
|
102
|
+
declare const StytchLogin: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ config, styles, callbacks }: StytchProps<TProjectConfiguration>) => React.JSX.Element;
|
|
103
|
+
interface StytchResetPasswordProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> extends StytchProps<TProjectConfiguration> {
|
|
105
104
|
passwordResetToken: string;
|
|
106
105
|
}
|
|
107
106
|
/**
|
|
@@ -140,13 +139,13 @@ interface StytchResetPasswordProps extends StytchProps {
|
|
|
140
139
|
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
141
140
|
* @param callbacks - An optional {@link Callbacks} object
|
|
142
141
|
*/
|
|
143
|
-
declare const StytchPasswordReset: ({ config, styles, callbacks, passwordResetToken }: StytchResetPasswordProps) => React.JSX.Element;
|
|
144
|
-
declare const StytchPasskeyRegistration: ({ config, styles, callbacks }: StytchProps) => React.JSX.Element;
|
|
142
|
+
declare const StytchPasswordReset: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ config, styles, callbacks, passwordResetToken }: StytchResetPasswordProps<TProjectConfiguration>) => React.JSX.Element;
|
|
143
|
+
declare const StytchPasskeyRegistration: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ config, styles, callbacks }: StytchProps<TProjectConfiguration>) => React.JSX.Element;
|
|
145
144
|
/**
|
|
146
145
|
* The Stytch Client object passed in to <StytchProvider /> in your application root.
|
|
147
146
|
* Either a StytchUIClient or StytchHeadlessClient.
|
|
148
147
|
*/
|
|
149
|
-
type StytchClient = StytchUIClient | StytchHeadlessClient
|
|
148
|
+
type StytchClient<TProjectConfiguration extends StytchProjectConfigurationInput> = StytchUIClient<TProjectConfiguration> | StytchHeadlessClient<TProjectConfiguration>;
|
|
150
149
|
type SWRUser = {
|
|
151
150
|
/**
|
|
152
151
|
* Either the active {@link User} object, or null if the user is not logged in.
|
|
@@ -197,9 +196,9 @@ declare const useStytchSession: () => SWRSession;
|
|
|
197
196
|
* stytch.magicLinks.authenticate('...')
|
|
198
197
|
* }, [stytch]);
|
|
199
198
|
*/
|
|
200
|
-
declare const useStytch: () => StytchClient
|
|
201
|
-
declare const withStytch: <T extends object>(Component: React.ComponentType<T & {
|
|
202
|
-
stytch: StytchClient
|
|
199
|
+
declare const useStytch: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>() => StytchClient<TProjectConfiguration>;
|
|
200
|
+
declare const withStytch: <T extends object, TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>(Component: React.ComponentType<T & {
|
|
201
|
+
stytch: StytchClient<TProjectConfiguration>;
|
|
203
202
|
}>) => React.ComponentType<T>;
|
|
204
203
|
declare const withStytchUser: <T extends object>(Component: React.ComponentType<T & {
|
|
205
204
|
stytchUser: User | null;
|
|
@@ -209,11 +208,11 @@ declare const withStytchSession: <T extends object>(Component: React.ComponentTy
|
|
|
209
208
|
stytchSession: Session | null;
|
|
210
209
|
stytchSessionIsFromCache: boolean;
|
|
211
210
|
}>) => React.ComponentType<T>;
|
|
212
|
-
type StytchProviderProps = {
|
|
211
|
+
type StytchProviderProps<TProjectConfiguration extends StytchProjectConfigurationInput = Stytch.DefaultProjectConfiguration> = {
|
|
213
212
|
/**
|
|
214
213
|
* A Stytch client instance, either a {@link StytchUIClient} or {@link StytchHeadlessClient}
|
|
215
214
|
*/
|
|
216
|
-
stytch: StytchClient
|
|
215
|
+
stytch: StytchClient<TProjectConfiguration>;
|
|
217
216
|
children?: ReactNode;
|
|
218
217
|
};
|
|
219
218
|
/**
|
|
@@ -229,6 +228,6 @@ type StytchProviderProps = {
|
|
|
229
228
|
* document.getElementById('root'),
|
|
230
229
|
* )
|
|
231
230
|
*/
|
|
232
|
-
declare const StytchProvider: ({ stytch, children }: StytchProviderProps) => JSX.Element;
|
|
231
|
+
declare const StytchProvider: <TProjectConfiguration extends Partial<import("core/dist/public").StytchProjectConfiguration> = Stytch.DefaultProjectConfiguration>({ stytch, children }: StytchProviderProps<TProjectConfiguration>) => JSX.Element;
|
|
233
232
|
export { StytchLogin, StytchPasswordReset, StytchPasskeyRegistration, StytchProvider, useStytch, useStytchSession, useStytchUser, withStytch, withStytchSession, withStytchUser };
|
|
234
233
|
export type { StytchProviderProps };
|
package/dist/index.esm.js
CHANGED
|
@@ -96,7 +96,7 @@ const withStytchSession = (Component) => {
|
|
|
96
96
|
* document.getElementById('root'),
|
|
97
97
|
* )
|
|
98
98
|
*/
|
|
99
|
-
const StytchProvider = ({ stytch, children }) => {
|
|
99
|
+
const StytchProvider = ({ stytch, children, }) => {
|
|
100
100
|
invariant(!useIsMounted__INTERNAL(), providerMustBeUniqueError);
|
|
101
101
|
invariant(typeof window !== 'undefined', noSSRError);
|
|
102
102
|
const ctx = useMemo(() => ({ client: stytch, isMounted: true }), [stytch]);
|
|
@@ -149,7 +149,7 @@ const StytchProvider = ({ stytch, children }) => {
|
|
|
149
149
|
* />
|
|
150
150
|
* @param props {@link StytchProps}
|
|
151
151
|
*/
|
|
152
|
-
const StytchLogin = ({ config, styles, callbacks }) => {
|
|
152
|
+
const StytchLogin = ({ config, styles, callbacks, }) => {
|
|
153
153
|
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchLogin />'));
|
|
154
154
|
const stytchClient = useStytch();
|
|
155
155
|
const containerEl = useRef(null);
|
|
@@ -209,7 +209,7 @@ const StytchLogin = ({ config, styles, callbacks }) => {
|
|
|
209
209
|
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
210
210
|
* @param callbacks - An optional {@link Callbacks} object
|
|
211
211
|
*/
|
|
212
|
-
const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken }) => {
|
|
212
|
+
const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken, }) => {
|
|
213
213
|
invariant(useIsMounted__INTERNAL(), noProviderError('<StytchResetPassword />'));
|
|
214
214
|
const stytchClient = useStytch();
|
|
215
215
|
const containerEl = useRef(null);
|
|
@@ -236,7 +236,7 @@ const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken })
|
|
|
236
236
|
}, [stytchClient, config, styles, callbacks, passwordResetToken]);
|
|
237
237
|
return React.createElement("div", { ref: containerEl });
|
|
238
238
|
};
|
|
239
|
-
const StytchPasskeyRegistration = ({ config, styles, callbacks }) => {
|
|
239
|
+
const StytchPasskeyRegistration = ({ config, styles, callbacks, }) => {
|
|
240
240
|
/**
|
|
241
241
|
* The Stytch Passkey Registration component.
|
|
242
242
|
* This component can only be used with a {@link StytchUIClient} client constructor
|
package/dist/index.js
CHANGED
|
@@ -104,7 +104,7 @@ const withStytchSession = (Component) => {
|
|
|
104
104
|
* document.getElementById('root'),
|
|
105
105
|
* )
|
|
106
106
|
*/
|
|
107
|
-
const StytchProvider = ({ stytch, children }) => {
|
|
107
|
+
const StytchProvider = ({ stytch, children, }) => {
|
|
108
108
|
invariant.invariant(!useIsMounted__INTERNAL(), invariant.providerMustBeUniqueError);
|
|
109
109
|
invariant.invariant(typeof window !== 'undefined', invariant.noSSRError);
|
|
110
110
|
const ctx = React.useMemo(() => ({ client: stytch, isMounted: true }), [stytch]);
|
|
@@ -157,7 +157,7 @@ const StytchProvider = ({ stytch, children }) => {
|
|
|
157
157
|
* />
|
|
158
158
|
* @param props {@link StytchProps}
|
|
159
159
|
*/
|
|
160
|
-
const StytchLogin = ({ config, styles, callbacks }) => {
|
|
160
|
+
const StytchLogin = ({ config, styles, callbacks, }) => {
|
|
161
161
|
invariant.invariant(useIsMounted__INTERNAL(), invariant.noProviderError('<StytchLogin />'));
|
|
162
162
|
const stytchClient = useStytch();
|
|
163
163
|
const containerEl = React.useRef(null);
|
|
@@ -217,7 +217,7 @@ const StytchLogin = ({ config, styles, callbacks }) => {
|
|
|
217
217
|
* @param styles - An optional {@link StyleConfig} to customize the look and feel of the screen.
|
|
218
218
|
* @param callbacks - An optional {@link Callbacks} object
|
|
219
219
|
*/
|
|
220
|
-
const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken }) => {
|
|
220
|
+
const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken, }) => {
|
|
221
221
|
invariant.invariant(useIsMounted__INTERNAL(), invariant.noProviderError('<StytchResetPassword />'));
|
|
222
222
|
const stytchClient = useStytch();
|
|
223
223
|
const containerEl = React.useRef(null);
|
|
@@ -244,7 +244,7 @@ const StytchPasswordReset = ({ config, styles, callbacks, passwordResetToken })
|
|
|
244
244
|
}, [stytchClient, config, styles, callbacks, passwordResetToken]);
|
|
245
245
|
return React__default["default"].createElement("div", { ref: containerEl });
|
|
246
246
|
};
|
|
247
|
-
const StytchPasskeyRegistration = ({ config, styles, callbacks }) => {
|
|
247
|
+
const StytchPasskeyRegistration = ({ config, styles, callbacks, }) => {
|
|
248
248
|
/**
|
|
249
249
|
* The Stytch Passkey Registration component.
|
|
250
250
|
* This component can only be used with a {@link StytchUIClient} client constructor
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stytch/react",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"description": "Stytch's official React Library",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@babel/runtime": "7.18.6",
|
|
36
36
|
"@stytch/js-utils": "0.0.0",
|
|
37
|
-
"@stytch/vanilla-js": "5.
|
|
37
|
+
"@stytch/vanilla-js": "5.11.0",
|
|
38
38
|
"@testing-library/react": "14.0.0",
|
|
39
39
|
"eslint-config-custom": "0.0.1",
|
|
40
40
|
"react": "18.2.0",
|