@usethrottle/checkout-react 2.0.0 → 2.1.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
@@ -132,9 +132,12 @@ export function MyEmbed({ sessionId }: { sessionId: string }) {
132
132
  Own a Throttle cart directly from the browser — no backend, no secret key. The
133
133
  hook wraps `@usethrottle/cart`'s `CartSessionClient`: it creates the cart lazily
134
134
  on the first `addItem`, persists the session id to `localStorage`, resumes it on
135
- the next visit, and exposes reactive `cart` state. Authorize with a publishable
136
- `pk_` quote token + your application's origin allowlist (set origins via
137
- `PUT /api/v1/embed-config`).
135
+ the next visit, and exposes reactive `cart` state. Authorize with a storefront quote
136
+ token (`qt_…`, from the dashboard Shipping & Tax page or
137
+ `POST /api/v1/shipping-tax/quote-tokens`) + your application's origin allowlist
138
+ (set origins via `PUT /api/v1/embed-config`). Quote tokens minted before `qt_`
139
+ start with `pk_` and keep working. A `pk_` publishable API key is a different
140
+ credential and is refused with `401 invalid_quote_token`.
138
141
 
139
142
  ```tsx
140
143
  import { useCartSession } from '@usethrottle/checkout-react';
@@ -143,7 +146,7 @@ function Cart() {
143
146
  const cart = useCartSession({
144
147
  applicationId: '7f9d4c8a-5b2e-4f16-9a73-2d1e5c8b6f40',
145
148
  environmentId: 'a1b2c3d4-...',
146
- quoteToken: 'pk_live_...',
149
+ quoteToken: 'qt_...',
147
150
  });
148
151
 
149
152
  return (
@@ -185,7 +188,7 @@ over signed HTTP).
185
188
  | ----------------------- | ------------------------------- | ----------------------------------- |
186
189
  | `throttle.ready` | iframe mounted | `onReady()` |
187
190
  | `throttle.processing` | user clicked Pay; awaiting auth | `onProcessing()` |
188
- | `throttle.completed` | payment captured | `onSucceeded({orderId, paymentId})` |
191
+ | `throttle.completed` | payment captured | `onSucceeded({orderId, paymentId, subscriptionId?, subscriptionIds?})` |
189
192
  | `throttle.error` | card declined / network failure | `onFailed({code, message})` |
190
193
  | `throttle.cancelled` | user dismissed | `onCanceled()` |
191
194
  | `throttle.step.changed` | (CheckoutEmbed) step transition | `onStepChanged({step})` |