arky-sdk 0.10.0 → 0.11.1

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
@@ -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.mountStripe("#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.mountStripe("#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