@bytescale/sdk
Advanced tools
Comparing version 3.15.0 to 3.16.0
@@ -22,6 +22,8 @@ import { BytescaleApiClientConfig } from "../../public/shared"; | ||
/** | ||
* The Bytescale Auth Service Worker enables JWT-based auth for browsers that block third-party cookies. | ||
* Enables support for modern browsers that block third-party cookies (like Safari). | ||
* | ||
* You must set this field if you need to support browsers that block third-party cookies (like Safari). | ||
* The value of this field must be the path to the service worker JavaScript file hosted at the root of your website. | ||
* | ||
* OVERVIEW: | ||
* | ||
* This feature works by running a "service worker" in the background that adds "Authorization" and "Authorization-Token" | ||
@@ -34,17 +36,19 @@ * request headers to HTTP requests made to the Bytescale CDN. This allows the Bytescale CDN to authorize requests | ||
* | ||
* Usage: | ||
* INSTRUCTIONS: | ||
* | ||
* 1. Create a JavaScript file that contains the following line: | ||
* 1. Your JWT must include the 'accountId' field at the root of the 'payload' section of the JWT (i.e. next to the 'exp' field). | ||
* | ||
* 2. Create a JavaScript file that contains the following line: | ||
* | ||
* importScripts("https://js.bytescale.com/auth-sw/v1"); | ||
* | ||
* 2. Host this JavaScript file from your website: | ||
* 3. Host this JavaScript file from your website: | ||
* | ||
* 2a. It MUST be under the ROOT directory of your website. | ||
* 3a. It MUST be under the ROOT directory of your website. | ||
* (e.g. "/bytescale-auth-sw.js") | ||
* | ||
* 2b. It MUST be on the SAME DOMAIN as your website. | ||
* 3b. It MUST be on the SAME DOMAIN as your website. | ||
* (e.g. "www.example.com" and not "assets.example.com") | ||
* | ||
* 3. Specify the absolute path to your JavaScript file in the 'beginAuthSession' call. | ||
* 4. Specify the absolute path to your JavaScript file in the 'beginAuthSession' call. | ||
* (e.g. { ..., serviceWorkerScript: "/bytescale-auth-sw.js" }) | ||
@@ -51,0 +55,0 @@ * |
{ | ||
"name": "@bytescale/sdk", | ||
"version": "3.15.0", | ||
"version": "3.16.0", | ||
"description": "Bytescale JavaScript SDK", | ||
@@ -5,0 +5,0 @@ "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)", |
980936
20478