@stytch/vanilla-js 5.16.0 → 5.17.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.
Files changed (38) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/dist/BootstrapDataManager.d.ts +1 -0
  3. package/dist/IDPClient.d.ts +34 -0
  4. package/dist/NetworkClient.d.ts +1 -0
  5. package/dist/StytchUIClient.d.ts +20 -0
  6. package/dist/adminPortal/index.esm.js +1 -1
  7. package/dist/adminPortal/index.js +1 -1
  8. package/dist/b2b/B2BIDPClient.d.ts +36 -0
  9. package/dist/b2b/StytchB2BUIClient.d.ts +23 -0
  10. package/dist/b2b/index.esm.js +1034 -372
  11. package/dist/b2b/index.headless.esm.js +266 -186
  12. package/dist/b2b/index.headless.js +266 -185
  13. package/dist/b2b/index.js +1035 -372
  14. package/dist/{extractErrorMessage-HMnBBd4l.js → extractErrorMessage-B3n3Ha6V.js} +2 -2
  15. package/dist/{extractErrorMessage-BM4n36Tv.js → extractErrorMessage-BCwCOwx4.js} +2 -1
  16. package/dist/index.esm.js +1 -1
  17. package/dist/index.headless.esm.js +915 -769
  18. package/dist/index.headless.js +915 -768
  19. package/dist/index.js +1 -1
  20. package/dist/{internal-DPG_14Ie.js → internal-CVhHewZm.js} +1243 -1175
  21. package/dist/{internal-Ce3H__v2.js → internal-chNk7tBu.js} +1242 -1176
  22. package/dist/types.d.ts +9 -0
  23. package/dist/ui/b2b/App.d.ts +4 -1
  24. package/dist/ui/b2b/ConsentManifestGeneratorProvider.d.ts +9 -0
  25. package/dist/ui/b2b/GlobalContextProvider.d.ts +2 -1
  26. package/dist/ui/b2b/hooks/useStytchMember.d.ts +2 -0
  27. package/dist/ui/b2b/screens/IDPConsent.d.ts +2 -0
  28. package/dist/ui/b2c/App.d.ts +4 -1
  29. package/dist/ui/b2c/GlobalContextProvider.d.ts +2 -1
  30. package/dist/ui/b2c/screens/IdentityProvider/IDPConsent.d.ts +2 -0
  31. package/dist/ui/b2c/utils.d.ts +5 -1
  32. package/dist/ui/components/ErrorScreen.d.ts +3 -0
  33. package/dist/ui/components/IDPConsent.d.ts +36 -0
  34. package/dist/ui/components/IDPConsentManifest.d.ts +10 -0
  35. package/dist/ui/hooks/useStytchUser.d.ts +2 -0
  36. package/dist/utils/idpHelpers.d.ts +26 -0
  37. package/dist/utils/internal.d.ts +4 -0
  38. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # @stytch/vanilla-js
2
2
 
3
+ ## 5.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0abb940: feat: Connected Apps OAuth Authorization component support (BETA)
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [0abb940]
12
+ - @stytch/core@2.42.0
13
+
3
14
  ## 5.16.0
4
15
 
5
16
  ### Minor Changes
@@ -6,6 +6,7 @@ export interface IBootstrapData {
6
6
  }
7
7
  interface RawBootstrapData {
8
8
  request_id: string;
9
+ project_name: string;
9
10
  status_code: number;
10
11
  disable_sdk_watermark: boolean;
11
12
  cname_domain: string | null;
@@ -0,0 +1,34 @@
1
+ import { NetworkClient } from './NetworkClient';
2
+ import { ResponseCommon } from '@stytch/core/public';
3
+ export type OAuthAuthorizeStartOptions = {
4
+ client_id: string;
5
+ redirect_uri: string;
6
+ response_type: string;
7
+ scope: string;
8
+ };
9
+ export type OIDCClientPublic = {
10
+ client_id: string;
11
+ client_type: string;
12
+ client_name: string;
13
+ client_description: string;
14
+ };
15
+ export type OAuthAuthorizeStartResponse = ResponseCommon & {
16
+ consent_required: boolean;
17
+ oidc_client: OIDCClientPublic;
18
+ };
19
+ export type OAuthAuthorizeSubmitOptions = {
20
+ client_id: string;
21
+ redirect_uri: string;
22
+ response_type: string;
23
+ scope: string;
24
+ state: string;
25
+ nonce: string;
26
+ code_challenge: string;
27
+ consent_granted: boolean;
28
+ };
29
+ export declare class IDPClient {
30
+ private _networkClient;
31
+ constructor(_networkClient: NetworkClient);
32
+ oauthAuthorizeStart: (data: OAuthAuthorizeStartOptions) => Promise<OAuthAuthorizeStartResponse>;
33
+ oauthAuthorizeSubmit: (data: OAuthAuthorizeSubmitOptions) => Promise<void>;
34
+ }
@@ -20,6 +20,7 @@ export declare class NetworkClient implements INetworkClient {
20
20
  }): void;
21
21
  createTelemetryBlob(): SDKTelemetry;
22
22
  fetchSDK<T extends ResponseCommon>({ url, body, method }: SDKRequestInfo): Promise<T>;
23
+ submitFormSDK({ url, body, method }: SDKRequestInfo): Promise<void>;
23
24
  retriableFetchSDK<T extends ResponseCommon>({ url, body, method, retryCallback, }: RetriableSDKRequestInfo): Promise<T>;
24
25
  buildSDKUrl(url: string): string;
25
26
  }
@@ -83,4 +83,24 @@ export declare class StytchUIClient<TProjectConfiguration extends StytchProjectC
83
83
  styles?: StyleConfig;
84
84
  callbacks?: Callbacks<TProjectConfiguration>;
85
85
  }): void;
86
+ /**
87
+ * Mounts an IDP Consent screen inside the element provided.
88
+ * Parses OAuth Authorization params (client_id, scope, nonce, etc.) out of the page URL.
89
+ * Requires the user to be logged in.
90
+ * @example
91
+ * stytchClient.mountIdentityProvider({
92
+ * elementId: '#idp-container',
93
+ * config: {...}
94
+ * });
95
+ *
96
+ * @param elementId - A string containing the id of the element that should contain the login screen.
97
+ * @param styles - A {@link StyleConfig} object containing custom styling info
98
+ * @param callbacks - Optional {@link Callbacks} triggered by various events in the Stytch SDK.
99
+ * @throws An error when the element specified by elementId cannot be found.
100
+ */
101
+ mountIdentityProvider({ elementId, styles, callbacks, }: {
102
+ elementId: string;
103
+ styles?: StyleConfig;
104
+ callbacks?: Callbacks<TProjectConfiguration>;
105
+ }): void;
86
106
  }