diff --git a/clients/javascript/async/src/un_async.js b/clients/javascript/async/src/un_async.js index 40e0993..fbcae25 100644 --- a/clients/javascript/async/src/un_async.js +++ b/clients/javascript/async/src/un_async.js @@ -2,6 +2,7 @@ * PUBLIC DOMAIN - NO LICENSE, NO WARRANTY * * unsandbox.com JavaScript SDK (Asynchronous with native fetch) + * Isomorphic: Works in Node.js (CLI + SDK) and Browser environments * * Library Usage: * import { @@ -36,11 +37,12 @@ * const snapshotId = await sessionSnapshot(sessionId, publicKey, secretKey, 'my-snapshot'); * const snapshots = await listSnapshots(publicKey, secretKey); * - * Authentication Priority (4-tier): + * Authentication Priority (5-tier): * 1. Function arguments (publicKey, secretKey) - * 2. Environment variables (UNSANDBOX_PUBLIC_KEY, UNSANDBOX_SECRET_KEY) - * 3. ~/.unsandbox/accounts.csv (if in Node.js) - * 4. ./accounts.csv (if in Node.js) + * 2. Environment variables (UNSANDBOX_PUBLIC_KEY, UNSANDBOX_SECRET_KEY) [Node.js] + * 3. localStorage (unsandboxPublicKey, unsandboxSecretKey) [Browser] + * 4. ~/.unsandbox/accounts.csv [Node.js] + * 5. ./accounts.csv [Node.js] * * Request Authentication (HMAC-SHA256): * Authorization: Bearer @@ -51,11 +53,32 @@ * - Cached in ~/.unsandbox/languages.json (Node.js only) * - TTL: 1 hour * - Updated on successful API calls + * + * Browser Usage: + * - Import as ES module: