@stytch/vanilla-js 2.2.2 → 3.0.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,21 @@
1
1
  # @stytch/vanilla-js
2
2
 
3
+ ## 3.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 5dd9d24: Change export of B2B Headless Client to separate subpackage to improve tree-shaking performance
8
+
9
+ ```javascript
10
+ import { StytchB2BHeadlessClient } from '@stytch/vanilla-js/b2b';
11
+ ```
12
+
13
+ Is now updated to
14
+
15
+ ```javascript
16
+ import { StytchB2BHeadlessClient } from '@stytch/vanilla-js/b2b/headless';
17
+ ```
18
+
3
19
  ## 2.2.2
4
20
 
5
21
  ### Patch Changes
package/README.md CHANGED
@@ -12,7 +12,7 @@ npm install @stytch/vanilla-js
12
12
 
13
13
  The vanilla Stytch Javascript SDK is built on open web standards and is compatible with all Javascript frameworks.
14
14
 
15
- ### `StytchUIClient`
15
+ ### **B2C** `StytchUIClient`
16
16
 
17
17
  The Stytch UI Client provides methods for interacting with the Stytch API from a browser environment, along with prebuilt UI components such as our login form.
18
18
 
@@ -45,9 +45,9 @@ stytch.mountLogin({
45
45
  });
46
46
  ```
47
47
 
48
- ### `StytchHeadlessClient`
48
+ ### **B2C** `StytchHeadlessClient`
49
49
 
50
- Developers that don't use Stytch UI elements can use the `StytchHeadlessClient` instead, which is _significantly_ smaller (sub-20kb gzipped!)
50
+ Developers that don't use Stytch UI elements can use the `StytchHeadlessClient` instead, which is _significantly_ smaller!
51
51
 
52
52
  ```js
53
53
  import { StytchHeadlessClient } from '@stytch/vanilla-js/headless';
@@ -58,6 +58,58 @@ const stytch = new StytchHeadlessClient('public-token-test-xxxxxxxx-xxxx-xxxx-xx
58
58
  stytch.magicLinks.email.loginOrCreate('charles.babbage@example.com');
59
59
  ```
60
60
 
61
+ ### **B2B** `StytchB2BUIClient`
62
+
63
+ The Stytch UI Client provides methods for interacting with the Stytch API from a browser environment, along with prebuilt UI components such as our login form.
64
+
65
+ ```js
66
+ import { StytchB2BUIClient } from '@stytch/vanilla-js/b2b';
67
+
68
+ const stytch = new StytchB2BUIClient('public-token-test-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
69
+
70
+ // Call Stytch APIs from the browser
71
+ stytch.magicLinks.email.loginOrSignup({
72
+ email_address: 'charles.babbage@example.com',
73
+ organization_id: 'organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931',
74
+ });
75
+
76
+ // Render prebuilt UI
77
+ stytch.mountLogin({
78
+ elementId: '#magic-link',
79
+ config: {
80
+ products: ['emailMagicLinks', 'oauth'],
81
+ emailMagicLinksOptions: {
82
+ loginRedirectURL: 'https://example.com/authenticate',
83
+ loginExpirationMinutes: 30,
84
+ signupRedirectURL: 'https://example.com/authenticate',
85
+ signupExpirationMinutes: 30,
86
+ createUserAsPending: true,
87
+ },
88
+ oauthOptions: {
89
+ providers: [{ type: 'google' }, { type: 'microsoft' }],
90
+ loginRedirectURL: 'https://example.com/authenticate',
91
+ signupRedirectURL: 'https://example.com/authenticate',
92
+ },
93
+ },
94
+ });
95
+ ```
96
+
97
+ ### **B2C** `StytchB2BHeadlessClient`
98
+
99
+ Developers that don't use Stytch UI elements can use the `StytchB2BHeadlessClient` instead, which is _significantly_ smaller!
100
+
101
+ ```js
102
+ import { StytchB2BHeadlessClient } from '@stytch/vanilla-js/b2b/headless';
103
+
104
+ const stytch = new StytchB2BHeadlessClient('public-token-test-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx');
105
+
106
+ // Call Stytch APIs from the browser
107
+ stytch.magicLinks.email.loginOrSignup({
108
+ email_address: 'charles.babbage@example.com',
109
+ organization_id: 'organization-test-07971b06-ac8b-4cdb-9c15-63b17e653931',
110
+ });
111
+ ```
112
+
61
113
  For more information on how to use the Stytch SDK, please refer to the
62
114
  [docs](https://stytch.com/docs/javascript-sdk).
63
115
 
@@ -0,0 +1,6 @@
1
+ {
2
+ "internal": true,
3
+ "main": "../../dist/b2b/index.headless.js",
4
+ "module": "../../dist/b2b/index.headless.esm.js",
5
+ "types": "../../dist/b2b/index.headless.d.ts"
6
+ }
@@ -671,5 +671,5 @@ declare class StytchB2BUIClient extends StytchB2BHeadlessClient {
671
671
  config: StytchB2BUIConfig$0;
672
672
  }): void;
673
673
  }
674
- export { StytchB2BHeadlessClient, StytchB2BUIClient };
674
+ export { StytchB2BUIClient };
675
675
  export * from '@stytch/core/public';
@@ -671,5 +671,5 @@ declare class StytchB2BUIClient extends StytchB2BHeadlessClient {
671
671
  config: StytchB2BUIConfig$0;
672
672
  }): void;
673
673
  }
674
- export { StytchB2BHeadlessClient, StytchB2BUIClient };
674
+ export { StytchB2BUIClient };
675
675
  export * from '@stytch/core/public';
@@ -2887,7 +2887,7 @@ var Re = /*#__PURE__*/function () {
2887
2887
  },
2888
2888
  sdk: {
2889
2889
  identifier: "Stytch.js Javascript SDK",
2890
- version: "2.2.2"
2890
+ version: "3.0.0"
2891
2891
  }
2892
2892
  });
2893
2893
  }
@@ -15600,4 +15600,4 @@ var KA = /*#__PURE__*/function (_Xe) {
15600
15600
  }]);
15601
15601
  return KA;
15602
15602
  }(Xe);
15603
- export { em as AuthFlowType, tm as B2BOAuthProviders, Xh as B2BProducts, Zh as BiometricsErrors, Lh as OAuthProviders, zh as OTPMethods, Dh as OneTapPositions, Rh as Products, nm as SDKAPIUnreachableError, Xe as StytchB2BHeadlessClient, KA as StytchB2BUIClient, Nh as StytchEventType, im as StytchSDKAPIError, am as StytchSDKNativeError, om as StytchSDKSchemaError, rm as StytchSDKUsageError, sm as UNRECOVERABLE_ERROR_TYPES, Mh as Wallets };
15603
+ export { em as AuthFlowType, tm as B2BOAuthProviders, Xh as B2BProducts, Zh as BiometricsErrors, Lh as OAuthProviders, zh as OTPMethods, Dh as OneTapPositions, Rh as Products, nm as SDKAPIUnreachableError, KA as StytchB2BUIClient, Nh as StytchEventType, im as StytchSDKAPIError, am as StytchSDKNativeError, om as StytchSDKSchemaError, rm as StytchSDKUsageError, sm as UNRECOVERABLE_ERROR_TYPES, Mh as Wallets };