@baclet/sdk 0.2.1 → 0.2.2

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 CHANGED
@@ -20,6 +20,14 @@ npm install @baclet/sdk
20
20
 
21
21
  Requires Node.js 18+ or a modern browser with `fetch` support.
22
22
 
23
+ ### Where to get your keys
24
+
25
+ Open the dashboard, choose a workspace, then go to **Projects → your project → API Keys**. You can also use **API Keys** in the workspace sidebar and select **Manage keys** beside the project.
26
+
27
+ - **API URL** → use as `apiUrl`
28
+ - **Publishable key** → use as `publishableKey`; safe for client code
29
+ - **Secret key** → server-only; shown in full only when created or rotated
30
+
23
31
  ---
24
32
 
25
33
  ## Quickstart
package/dist/index.js CHANGED
@@ -119,7 +119,7 @@ export class BacletClient {
119
119
  this.secretKey = options.secretKey;
120
120
  this.projectID = projectIDFromKey(options.publishableKey);
121
121
  this.storage = resolveStorage(options.storage);
122
- this.fetchImpl = options.fetch ?? globalThis.fetch;
122
+ this.fetchImpl = (options.fetch ?? globalThis.fetch).bind(globalThis);
123
123
  if (typeof this.fetchImpl !== "function") {
124
124
  throw new BacletError("This runtime does not provide fetch; pass options.fetch.", 500);
125
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@baclet/sdk",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "BACLET users database SDK for browsers and servers",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",