@stytch/vanilla-js 4.7.8 → 4.9.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 CHANGED
@@ -1,5 +1,38 @@
1
1
  # @stytch/vanilla-js
2
2
 
3
+ ## 4.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - a0fbe9f: Add `stytch.onStateChange` event listener to headless clients
8
+ - a0fbe9f: Add `getInfo` method to user, session, member, and organization
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies [a0fbe9f]
13
+ - Updated dependencies [a0fbe9f]
14
+ - @stytch/core@2.13.0
15
+
16
+ ## 4.8.0
17
+
18
+ ### Minor Changes
19
+
20
+ - b007d98: Enable FedCM for use with Google One Tap by default. For users using supported browsers (including Google Chrome and other Chromium-based browsers), Google One Tap will now use [FedCM to provide a sign in experience using native browser prompts](https://developers.google.com/identity/gsi/web/guides/fedcm-migration).
21
+
22
+ Due to changes in Google's One Tap SDK, this affects One Tap using both floating and embedded positioning. Notably, users of Chrome and other Chromium-based browsers will no longer see a embedded One Tap UI by default. Google will begin to remove support for this UI later this year. We recommend adopting the new default behavior, but we have added new position options if you require different behavior:
23
+
24
+ - `floating` remains the default option and uses Google's One Tap SDK's default behavior. It uses FedCM (native browser UI) where available, or renders a floating UI in the top right corner otherwise.
25
+ - `floatingOrEmbedded` uses FedCM where available, or renders an embedded UI in the existing SDK login form otherwise. This is the new default behavior of the `embedded` position, which has been deprecated and renamed for clarity.
26
+ - `embeddedOnly` renders the embedded UI in the existing SDK login form if FedCM is not available, or not at all otherwise. This option is not recommended for new applications. For applications that used `embedded` positioning and do not want to show floating or native browser UI, this option may be useful.
27
+ - `forceLegacyEmbedded` retains the legacy behavior by disabling FedCM support even where it is available. This option is not recommended and will stop being honored by Google in the future, at which time you will need to select a different option.
28
+
29
+ The `embedded` position will still be recognized and treated as `floatingOrEmbedded`, but we recommend updating your configuration to use the new name or a different option.
30
+
31
+ ### Patch Changes
32
+
33
+ - Updated dependencies [b007d98]
34
+ - @stytch/core@2.12.0
35
+
3
36
  ## 4.7.8
4
37
 
5
38
  ### Patch Changes
@@ -1,4 +1,5 @@
1
- import { IHeadlessB2BDiscoveryClient, IHeadlessB2BMagicLinksClient, IHeadlessB2BMemberClient, IHeadlessB2BSelfClient, IHeadlessB2BOAuthClient, IHeadlessB2BOrganizationClient, IHeadlessB2BOTPsClient, IHeadlessB2BTOTPsClient, IHeadlessB2BSessionClient, IHeadlessB2BSSOClient, IHeadlessB2BRecoveryCodesClient, IHeadlessB2BRBACClient, StytchClientOptions, IHeadlessB2BPasswordClient, Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/core/public";
1
+ import { StateChangeRegisterFunction } from "@stytch/core";
2
+ import { IHeadlessB2BDiscoveryClient, IHeadlessB2BMagicLinksClient, IHeadlessB2BMemberClient, IHeadlessB2BSelfClient, IHeadlessB2BOAuthClient, IHeadlessB2BOrganizationClient, IHeadlessB2BOTPsClient, IHeadlessB2BTOTPsClient, IHeadlessB2BSessionClient, IHeadlessB2BSSOClient, IHeadlessB2BRecoveryCodesClient, IHeadlessB2BRBACClient, StytchClientOptions, B2BState, IHeadlessB2BPasswordClient, Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/core/public";
2
3
  /**
3
4
  * A headless client used for invoking Stytch's B2B APIs.
4
5
  * The Stytch Headless Client can be used as a drop-in solution for authentication and session management.
@@ -16,6 +17,7 @@ declare class StytchB2BHeadlessClient {
16
17
  private readonly _sessionManager;
17
18
  private readonly _networkClient;
18
19
  private readonly _dataLayer;
20
+ private readonly _stateChangeClient;
19
21
  // External API Clients
20
22
  magicLinks: IHeadlessB2BMagicLinksClient;
21
23
  session: IHeadlessB2BSessionClient;
@@ -31,6 +33,19 @@ declare class StytchB2BHeadlessClient {
31
33
  totp: IHeadlessB2BTOTPsClient;
32
34
  recoveryCodes: IHeadlessB2BRecoveryCodesClient;
33
35
  rbac: IHeadlessB2BRBACClient;
36
+ // External methods
37
+ /**
38
+ * Register a callback function to be invoked whenever certain state changes
39
+ * occur, like a member or session object being updated.
40
+ *
41
+ * This is an alternative to more specific methods like `self.onChange` and
42
+ * `session.onChange`. It can be helpful if you want to be notified of related
43
+ * changes to different parts of state at once.
44
+ *
45
+ * If you are only interested in specific state changes, consider using more
46
+ * specific methods like `self.onChange` and `session.onChange` instead.
47
+ */
48
+ onStateChange: StateChangeRegisterFunction<B2BState>;
34
49
  constructor(_PUBLIC_TOKEN: string, options?: StytchClientOptions);
35
50
  }
36
51
  /**
@@ -1,4 +1,5 @@
1
- import { IHeadlessB2BDiscoveryClient, IHeadlessB2BMagicLinksClient, IHeadlessB2BMemberClient, IHeadlessB2BSelfClient, IHeadlessB2BOAuthClient, IHeadlessB2BOrganizationClient, IHeadlessB2BOTPsClient, IHeadlessB2BTOTPsClient, IHeadlessB2BSessionClient, IHeadlessB2BSSOClient, IHeadlessB2BRecoveryCodesClient, IHeadlessB2BRBACClient, StytchClientOptions, IHeadlessB2BPasswordClient, Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/core/public";
1
+ import { StateChangeRegisterFunction } from "@stytch/core";
2
+ import { IHeadlessB2BDiscoveryClient, IHeadlessB2BMagicLinksClient, IHeadlessB2BMemberClient, IHeadlessB2BSelfClient, IHeadlessB2BOAuthClient, IHeadlessB2BOrganizationClient, IHeadlessB2BOTPsClient, IHeadlessB2BTOTPsClient, IHeadlessB2BSessionClient, IHeadlessB2BSSOClient, IHeadlessB2BRecoveryCodesClient, IHeadlessB2BRBACClient, StytchClientOptions, B2BState, IHeadlessB2BPasswordClient, Callbacks, StyleConfig, StytchB2BUIConfig } from "@stytch/core/public";
2
3
  /**
3
4
  * A headless client used for invoking Stytch's B2B APIs.
4
5
  * The Stytch Headless Client can be used as a drop-in solution for authentication and session management.
@@ -16,6 +17,7 @@ declare class StytchB2BHeadlessClient {
16
17
  private readonly _sessionManager;
17
18
  private readonly _networkClient;
18
19
  private readonly _dataLayer;
20
+ private readonly _stateChangeClient;
19
21
  // External API Clients
20
22
  magicLinks: IHeadlessB2BMagicLinksClient;
21
23
  session: IHeadlessB2BSessionClient;
@@ -31,6 +33,19 @@ declare class StytchB2BHeadlessClient {
31
33
  totp: IHeadlessB2BTOTPsClient;
32
34
  recoveryCodes: IHeadlessB2BRecoveryCodesClient;
33
35
  rbac: IHeadlessB2BRBACClient;
36
+ // External methods
37
+ /**
38
+ * Register a callback function to be invoked whenever certain state changes
39
+ * occur, like a member or session object being updated.
40
+ *
41
+ * This is an alternative to more specific methods like `self.onChange` and
42
+ * `session.onChange`. It can be helpful if you want to be notified of related
43
+ * changes to different parts of state at once.
44
+ *
45
+ * If you are only interested in specific state changes, consider using more
46
+ * specific methods like `self.onChange` and `session.onChange` instead.
47
+ */
48
+ onStateChange: StateChangeRegisterFunction<B2BState>;
34
49
  constructor(_PUBLIC_TOKEN: string, options?: StytchClientOptions);
35
50
  }
36
51
  /**