@stytch/vanilla-js 2.2.1 → 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 +22 -0
- package/README.md +55 -3
- package/b2b/headless/package.json +6 -0
- package/dist/b2b/index.d.ts +1 -1
- package/dist/b2b/index.esm.d.ts +1 -1
- package/dist/b2b/index.esm.js +3 -3
- package/dist/b2b/index.headless.d.ts +634 -0
- package/dist/b2b/index.headless.esm.d.ts +634 -0
- package/dist/b2b/index.headless.esm.js +3814 -0
- package/dist/b2b/index.headless.js +3814 -0
- package/dist/b2b/index.js +3 -3
- package/dist/index.esm.js +1 -1
- package/dist/index.headless.esm.js +2 -2
- package/dist/index.headless.js +2 -2
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
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
|
+
|
|
19
|
+
## 2.2.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 3c4fa89: Don't delete cookies from datalayer, let SubscriptionService handle instead.
|
|
24
|
+
|
|
3
25
|
## 2.2.1
|
|
4
26
|
|
|
5
27
|
### 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
|
|
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
|
|
package/dist/b2b/index.d.ts
CHANGED
package/dist/b2b/index.esm.d.ts
CHANGED
package/dist/b2b/index.esm.js
CHANGED
|
@@ -2887,7 +2887,7 @@ var Re = /*#__PURE__*/function () {
|
|
|
2887
2887
|
},
|
|
2888
2888
|
sdk: {
|
|
2889
2889
|
identifier: "Stytch.js Javascript SDK",
|
|
2890
|
-
version: "
|
|
2890
|
+
version: "3.0.0"
|
|
2891
2891
|
}
|
|
2892
2892
|
});
|
|
2893
2893
|
}
|
|
@@ -3256,7 +3256,7 @@ var $e = /*#__PURE__*/function () {
|
|
|
3256
3256
|
try {
|
|
3257
3257
|
r = JSON.parse(n);
|
|
3258
3258
|
} catch (e) {
|
|
3259
|
-
return
|
|
3259
|
+
return void this.syncToLocalStorage();
|
|
3260
3260
|
}
|
|
3261
3261
|
this.state = r;
|
|
3262
3262
|
}
|
|
@@ -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,
|
|
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 };
|