@schibsted/account-sdk-browser 4.8.7 → 5.0.0-beta.1
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/README.md +14 -10
- package/es5/global.js +719 -619
- package/es5/global.js.map +1 -1
- package/es5/global.min.js +1 -1
- package/es5/global.min.js.map +1 -1
- package/es5/identity.js +692 -592
- package/es5/identity.js.map +1 -1
- package/es5/identity.min.js +1 -1
- package/es5/identity.min.js.map +1 -1
- package/es5/index.js +724 -624
- package/es5/index.js.map +1 -1
- package/es5/index.min.js +1 -1
- package/es5/index.min.js.map +1 -1
- package/es5/monetization.js +1 -1
- package/es5/monetization.js.map +1 -1
- package/es5/monetization.min.js +1 -1
- package/es5/monetization.min.js.map +1 -1
- package/package.json +1 -1
- package/src/identity.d.ts +4 -1
- package/src/identity.js +117 -13
- package/src/version.js +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[](https://github.com/schibsted/account-sdk-browser)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
4
|
[](https://codecov.io/gh/schibsted/account-sdk-browser)
|
|
5
5
|
[](https://snyk.io/test/github/schibsted/account-sdk-browser)
|
|
6
6
|
|
|
@@ -17,27 +17,31 @@ This sdk mainly communicates with a service named Session Service, which is avai
|
|
|
17
17
|
domains (i.e. id.vg.no) to avoid Third-Party Cookie request.
|
|
18
18
|
|
|
19
19
|
Since browsers started to block Third-Party Cookies, your top domain from local machine needs to
|
|
20
|
-
match your
|
|
21
|
-
and will not be sent with XHR request.
|
|
20
|
+
match your Session Service top domain. Otherwise, the Session Service cookie will be a third-party cookie
|
|
21
|
+
and will not be sent with a XHR request.
|
|
22
22
|
|
|
23
|
-
The same applies to cross scheme requests. The
|
|
23
|
+
The same applies to cross scheme requests. The Session Service is hosted on https and therefore you need to [run your site with HTTPS locally](https://web.dev/how-to-use-local-https/).
|
|
24
24
|
|
|
25
|
-
For example if your `pre` domain is pre.sdk-example.com, and it uses id.pre.sdk-example.com
|
|
26
|
-
|
|
25
|
+
For example if your `pre` domain is pre.sdk-example.com, and it uses id.pre.sdk-example.com Session Service
|
|
26
|
+
domain, your local domain should be local.sdk-example.com.
|
|
27
27
|
|
|
28
28
|
1. Do `npm install --save @schibsted/account-sdk-browser`
|
|
29
29
|
1. Use this library as you would any other npm module: `import { Identity, Monetization, Payment } from '@schibsted/account-sdk-browser'`
|
|
30
30
|
With CommonJS it is possible to `require` the modules Identity, Monetization and Payment
|
|
31
|
-
by appending `/identity`, `/monetization'` or `/payment'
|
|
31
|
+
by appending `/identity`, `/monetization'` or `/payment'`.
|
|
32
32
|
1. Build your site as you prefer. This library uses modern JavaScript syntax (including async/await
|
|
33
33
|
and other ES2017 and WHATWG features) by default. We recommend that you do any transpilation
|
|
34
34
|
yourself for the browser versions you need to cater to. See [this paragraph](#polyfills) for
|
|
35
|
-
info about our
|
|
35
|
+
info about our Babel-ified version and info about polyfills.
|
|
36
36
|
1. Initiate the SDK and provide at least `clientId`, `env` and `sessionDomain`.
|
|
37
37
|
|
|
38
38
|
If this is for a new site and there is no sessionDomain yet, contact
|
|
39
39
|
[support](mailto:schibstedaccount@schibsted.com) to initiate the process.
|
|
40
40
|
|
|
41
|
+
## Migration to 5.x.x (ITP)
|
|
42
|
+
|
|
43
|
+
Follow the [migration guide](./MIGRATION.md).
|
|
44
|
+
|
|
41
45
|
## Simplified login widget
|
|
42
46
|
|
|
43
47
|
1. Ensure that your site has no site specific terms and conditions in the Schibsted account login flow.
|
|
@@ -194,7 +198,7 @@ will remove the Schibsted account brand session. User will still be logged into
|
|
|
194
198
|
|
|
195
199
|
The preferred method for checking whether a user has access to a product/subscription is
|
|
196
200
|
[Monetization#hasAccess](https://schibsted.github.io/account-sdk-browser/Monetization.html#hasAccess).
|
|
197
|
-
It requires using
|
|
201
|
+
It requires using Session Service, and supports both Schibsted account productId's and Zuora
|
|
198
202
|
feature id's.
|
|
199
203
|
|
|
200
204
|
#### Example
|
|
@@ -247,7 +251,7 @@ paymentSDK.payWithPaylink(paylink)
|
|
|
247
251
|
#### Polyfills
|
|
248
252
|
|
|
249
253
|
This SDK uses modern JavaScript features. If you support older browsers, you should use a tool like
|
|
250
|
-
babel to transform the JavaScript as needed. However
|
|
254
|
+
babel to transform the JavaScript as needed. However, since certain teams have deployment pipelines
|
|
251
255
|
where it's difficult to do their own transpilation, we do provide some opt-in es5 files as well:
|
|
252
256
|
|
|
253
257
|
1. `@schibsted/account-sdk-browser/es5`: Include both `Identity`, `Monetization` and `Payment`.
|