arky-sdk 0.11.1 → 0.11.3
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 +32 -6
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +55 -55
- package/dist/index.d.ts +55 -55
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,14 +10,19 @@ npm install arky-sdk
|
|
|
10
10
|
|
|
11
11
|
## Storefront quick start
|
|
12
12
|
|
|
13
|
+
The current browser contract is `arky-sdk@0.11.3`. Pin that exact version during the coordinated
|
|
14
|
+
prelaunch cutover so the Server, App, and storefront route/header contracts move together:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install --save-exact arky-sdk@0.11.3
|
|
18
|
+
```
|
|
19
|
+
|
|
13
20
|
Copy the Store publishable key from Developer and initialize one client:
|
|
14
21
|
|
|
15
22
|
```typescript
|
|
16
|
-
import { initialize } from "arky-sdk";
|
|
23
|
+
import { initialize } from "arky-sdk/storefront";
|
|
17
24
|
|
|
18
|
-
export const arky = initialize(
|
|
19
|
-
import.meta.env.PUBLIC_ARKY_PUBLISHABLE_KEY,
|
|
20
|
-
);
|
|
25
|
+
export const arky = initialize(import.meta.env.PUBLIC_ARKY_PUBLISHABLE_KEY);
|
|
21
26
|
```
|
|
22
27
|
|
|
23
28
|
`initialize` is synchronous. It makes no request and creates no visitor. Production requests use `https://api.arky.io` by default.
|
|
@@ -198,7 +203,8 @@ Authorization: Bearer arky_vst_...
|
|
|
198
203
|
```
|
|
199
204
|
|
|
200
205
|
For cart recovery, `cart.get({ id, token })` sends the recovery credential as
|
|
201
|
-
`X-Arky-Cart-Token`. It is never placed in the request URL or body
|
|
206
|
+
`X-Arky-Cart-Token`. It is never placed in the request URL or body, and the corresponding response
|
|
207
|
+
is private and non-cacheable.
|
|
202
208
|
|
|
203
209
|
Locale and market headers are omitted when no explicit context is set, allowing the server to use Store defaults.
|
|
204
210
|
|
|
@@ -215,6 +221,13 @@ initialize(publishableKey: string, {
|
|
|
215
221
|
|
|
216
222
|
One storefront client always represents one publishable key and one Store. To connect to another Store, initialize a second explicit client with its publishable key.
|
|
217
223
|
|
|
224
|
+
## Releasing
|
|
225
|
+
|
|
226
|
+
SDK packages are released only by tagging the current protected `master` commit with the exact
|
|
227
|
+
`v<package.json version>` tag. The `Publish SDK` workflow reruns `npm test` and publishes through
|
|
228
|
+
npm trusted publishing with provenance; configure that workflow as the package's trusted publisher
|
|
229
|
+
instead of storing a long-lived npm token.
|
|
230
|
+
|
|
218
231
|
## Admin client
|
|
219
232
|
|
|
220
233
|
Private operator integrations use the separate Admin client. Personal API tokens must never be exposed in browser code:
|
|
@@ -250,7 +263,7 @@ import {
|
|
|
250
263
|
type ArkyStore,
|
|
251
264
|
type StorefrontDto,
|
|
252
265
|
type StorefrontSetup,
|
|
253
|
-
} from "arky-sdk";
|
|
266
|
+
} from "arky-sdk/storefront";
|
|
254
267
|
import type { Block, Cart, Order, Price, Product, Service } from "arky-sdk";
|
|
255
268
|
|
|
256
269
|
type StorefrontProduct = StorefrontDto<Product>;
|
|
@@ -259,6 +272,19 @@ type StorefrontCart = StorefrontDto<Cart>;
|
|
|
259
272
|
|
|
260
273
|
Storefront request types intentionally contain no Store routing ID. Admin request types remain Store-explicit.
|
|
261
274
|
|
|
275
|
+
## Verification
|
|
276
|
+
|
|
277
|
+
Run the complete SDK package contract with one command:
|
|
278
|
+
|
|
279
|
+
```bash
|
|
280
|
+
npm test
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
It builds the distributable package and runs every SDK contract case. App alone owns cross-repository
|
|
284
|
+
Server compatibility against the exact immutable test Server image digest. Each storefront owns a
|
|
285
|
+
hermetic repo-local build/preview Playwright smoke through its own `npm test`; storefronts never pull
|
|
286
|
+
or run the shared test Server image.
|
|
287
|
+
|
|
262
288
|
## Adding an endpoint
|
|
263
289
|
|
|
264
290
|
When adding SDK methods:
|