arky-sdk 0.10.0 → 0.11.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.
- package/README.md +11 -3
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js.map +1 -1
- package/dist/index.cjs +43 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +43 -9
- package/dist/index.js.map +1 -1
- package/dist/storefront.cjs +42 -8
- package/dist/storefront.cjs.map +1 -1
- package/dist/storefront.js +42 -8
- package/dist/storefront.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -137,7 +137,7 @@ console.log(setup.languages.default, setup.markets.default);
|
|
|
137
137
|
Payment configuration belongs to Arky. Mounting card payment waits for setup internally and accepts no Stripe publishable key or connected Account ID:
|
|
138
138
|
|
|
139
139
|
```typescript
|
|
140
|
-
await arky.eshop.cart.payment.
|
|
140
|
+
await arky.eshop.cart.payment.mount("#payment", {
|
|
141
141
|
appearance: { theme: "stripe" },
|
|
142
142
|
});
|
|
143
143
|
```
|
|
@@ -145,12 +145,16 @@ await arky.eshop.cart.payment.mountStripe("#payment", {
|
|
|
145
145
|
For a paid flow outside the cart, pass only customer-facing amount and currency:
|
|
146
146
|
|
|
147
147
|
```typescript
|
|
148
|
-
await arky.eshop.cart.payment.
|
|
148
|
+
await arky.eshop.cart.payment.mount("#payment", {
|
|
149
149
|
amount: 2500,
|
|
150
150
|
currency: "EUR",
|
|
151
|
+
setupFutureUsage: "off_session",
|
|
151
152
|
});
|
|
152
153
|
```
|
|
153
154
|
|
|
155
|
+
`setupFutureUsage` is optional. Use `"off_session"` when the paid flow will
|
|
156
|
+
reuse the payment method later, such as a subscription.
|
|
157
|
+
|
|
154
158
|
## SSR and static generation
|
|
155
159
|
|
|
156
160
|
Anonymous reads work without browser storage. Stateful SSR requires an explicit request-local adapter so a server module cannot retain one visitor across requests:
|
|
@@ -175,7 +179,8 @@ The module facade exposes its low-level client as `arky.client`:
|
|
|
175
179
|
|
|
176
180
|
```typescript
|
|
177
181
|
await arky.client.eshop.product.find({ limit: 20 });
|
|
178
|
-
await arky.client.eshop.cart.current();
|
|
182
|
+
const cart = await arky.client.eshop.cart.current();
|
|
183
|
+
await arky.client.eshop.cart.get({ id: cart.id, token: cart.token });
|
|
179
184
|
await arky.client.cms.entry.find({
|
|
180
185
|
collection_id: "pages",
|
|
181
186
|
key: "homepage",
|
|
@@ -192,6 +197,9 @@ X-Arky-Market: ita
|
|
|
192
197
|
Authorization: Bearer arky_vst_...
|
|
193
198
|
```
|
|
194
199
|
|
|
200
|
+
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.
|
|
202
|
+
|
|
195
203
|
Locale and market headers are omitted when no explicit context is set, allowing the server to use Store defaults.
|
|
196
204
|
|
|
197
205
|
## Configuration
|