@itm-studio/partner-sdk 0.6.7 → 0.6.8

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 +15 -3
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -3491,7 +3491,21 @@ the API URL points to a backend with the partner merch API deployed.
3491
3491
 
3492
3492
  ### Delegated integration credentials (MCP)
3493
3493
 
3494
- The integration authentication mode accepts a backend-issued, short-lived **API** credential. It sends `x-itm-integration-access-token`; external MCP access tokens cannot authenticate to the business API.
3494
+ Use a short-lived API credential issued by the backend as
3495
+ `x-itm-integration-access-token`. Exchange the external MCP access token for
3496
+ this credential before calling the business API.
3497
+
3498
+ - `itm:workspace:read` covers approved workspace and catalog queries.
3499
+ - `itm:audience:read` additionally permits approved reads of audience and order data.
3500
+ - `itm:media:write` permits approved media library reads and the
3501
+ `createPartnerMediaUpload` and `completePartnerMediaUpload` mutations.
3502
+ [`uploadPartnerMedia`](#media-upload-flow) uses those mutations with the
3503
+ approved selections.
3504
+
3505
+ Send a single approved root field per request and select only its approved
3506
+ fields. The backend rejects aliases, directives, fragments, a second root
3507
+ field, and operations or fields outside the allowlist. See
3508
+ `INTEGRATION_SELECTIONS` and `INTEGRATION_MUTATION_SELECTIONS` in the backend.
3495
3509
 
3496
3510
  ```ts
3497
3511
  const client = createITMPartnerClient({
@@ -3506,6 +3520,4 @@ const { getPartnerBrand } = await client.query({
3506
3520
 
3507
3521
  Provide exactly one of `token`, `agentSession`, `agentAccess`, or `integration`. Extra headers cannot override credential headers, regardless of casing. Create a client per inbound request; asynchronous token getters run per API request. `signal` cancels requests in every authentication mode. `ITMPartnerTransportError` exposes the HTTP status without copying a possibly sensitive response body; GraphQL failures remain `GenqlError`.
3508
3522
 
3509
- An integration credential reads only what its scopes allow and writes one thing: with `itm:media:write` it can browse the media library (`getPartnerMediaAssets`, `getPartnerMediaAsset`) and upload into it (`createPartnerMediaUpload`, `completePartnerMediaUpload`, or `uploadPartnerMedia`, which selects only fields the credential may read). Every other mutation is refused.
3510
-
3511
3523
  This SDK does not log in operators, choose brands, retain OAuth refresh tokens, or decide permissions. The MCP caller handles OAuth and supplies the delegated API credential.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itm-studio/partner-sdk",
3
- "version": "0.6.7",
3
+ "version": "0.6.8",
4
4
  "description": "TypeScript SDK for the ITM Partner API — typed GraphQL client with zero introspection required",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",