@bytescale/sdk 3.6.0 → 3.8.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.
@@ -11,7 +11,7 @@ export interface BeginAuthSessionParams {
11
11
  */
12
12
  authHeaders: () => Promise<Record<string, string>>;
13
13
  /**
14
- * The fully-qualified URL for your backend API's auth endpoint.
14
+ * The fully-qualified URL for your backend API's auth endpoint (the endpoint that returns a JWT as plain text).
15
15
  */
16
16
  authUrl: string;
17
17
  /**
@@ -21,7 +21,9 @@ export interface BeginAuthSessionParams {
21
21
  }
22
22
  export interface AuthManagerInterface {
23
23
  /**
24
- * Begins an authenticated Bytescale API and Bytescale CDN session.
24
+ * Begins a JWT auth session with the Bytescale API and Bytescale CDN.
25
+ *
26
+ * Specifically, calling this method will cause the SDK to periodically acquire a JWT from your JWT endpoint. The SDK will then automatically include this JWT in all subsequent Bytescale API requests (via the 'authorization-token' request header) and also in all Bytescale CDN download requests (via a session cookie).
25
27
  *
26
28
  * You can only call this method if 'isAuthSessionActive() === false', else an error will be returned.
27
29
  *
@@ -33,7 +35,7 @@ export interface AuthManagerInterface {
33
35
  *
34
36
  * 1) You must add '?auth=true' to the URL of any private file you're trying to access. This includes the URLs you use in 'src' elements in img/video elements, etc.
35
37
  *
36
- * 2) You must await the promise before attempting to perform any downloads or API operations that require authentication.
38
+ * 2) You must await the returned promise before attempting to perform any downloads or API operations that require authentication.
37
39
  *
38
40
  * The auth process works as follows:
39
41
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytescale/sdk",
3
- "version": "3.6.0",
3
+ "version": "3.8.0",
4
4
  "description": "Bytescale JavaScript SDK",
5
5
  "author": "Bytescale <hello@bytescale.com> (https://www.bytescale.com)",
6
6
  "license": "MIT",
@@ -10,17 +10,36 @@
10
10
  "exports": {
11
11
  ".": {
12
12
  "node": {
13
- "require": "./dist/node/cjs/main.js",
14
- "import": "./dist/node/esm/main.mjs"
13
+ "require": {
14
+ "types": "./dist/types/index.d.ts",
15
+ "default": "./dist/node/cjs/main.js"
16
+ },
17
+ "import": {
18
+ "types": "./dist/types/index.d.ts",
19
+ "default": "./dist/node/esm/main.mjs"
20
+ }
15
21
  },
16
22
  "worker": {
17
- "require": "./dist/worker/cjs/main.js",
18
- "import": "./dist/worker/esm/main.mjs"
23
+ "require": {
24
+ "types": "./dist/types/index.d.ts",
25
+ "default": "./dist/worker/cjs/main.js"
26
+ },
27
+ "import": {
28
+ "types": "./dist/types/index.d.ts",
29
+ "default": "./dist/worker/esm/main.mjs"
30
+ }
19
31
  },
20
32
  "browser": {
21
- "require": "./dist/browser/cjs/main.js",
22
- "import": "./dist/browser/esm/main.mjs"
33
+ "require": {
34
+ "types": "./dist/types/index.d.ts",
35
+ "default": "./dist/browser/cjs/main.js"
36
+ },
37
+ "import": {
38
+ "types": "./dist/types/index.d.ts",
39
+ "default": "./dist/browser/esm/main.mjs"
40
+ }
23
41
  },
42
+ "types": "./dist/types/index.d.ts",
24
43
  "default": "./dist/browser/cjs/main.js"
25
44
  }
26
45
  },