@envsync-cloud/envsync-ts-sdk 0.7.8 → 0.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.
Files changed (2) hide show
  1. package/README.md +27 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -33,6 +33,33 @@ const apps = await sdk.applications.getApps();
33
33
  console.log(apps);
34
34
  ```
35
35
 
36
+ ## Multi-Org Bearer Token Usage
37
+
38
+ If one identity belongs to multiple organizations, bearer-token clients can
39
+ select the org for a single request by sending `X-EnvSync-Org-Id`.
40
+
41
+ ```ts
42
+ import { EnvSyncAPISDK } from "@envsync-cloud/envsync-ts-sdk";
43
+
44
+ const sdk = new EnvSyncAPISDK({
45
+ BASE: "https://api.envsync.cloud",
46
+ TOKEN: process.env.ENVSYNC_TOKEN,
47
+ HEADERS: async () => ({
48
+ "X-EnvSync-Org-Id": process.env.ENVSYNC_ORG_ID ?? "",
49
+ }),
50
+ });
51
+
52
+ const me = await sdk.authentication.whoami();
53
+
54
+ console.log(me.org.id);
55
+ ```
56
+
57
+ Notes:
58
+
59
+ - `X-EnvSync-Org-Id` is honored only for bearer-token requests.
60
+ - Cookie-session clients should continue using `POST /api/auth/switch-org`.
61
+ - API-key requests ignore this header.
62
+
36
63
  ## Runtime Notes
37
64
 
38
65
  - The SDK uses the generated `fetch` client from `openapi-typescript-codegen`.
package/package.json CHANGED
@@ -34,7 +34,7 @@
34
34
  "peerDependencies": {
35
35
  "typescript": "^5"
36
36
  },
37
- "version": "0.7.8",
37
+ "version": "0.8.0",
38
38
  "repository": {
39
39
  "type": "git",
40
40
  "url": "git+https://github.com/EnvSync-Cloud/envsync.git",