JavaScript / TypeScript
@shoppable/checkout is isomorphic (browser + Node), ships ESM, CJS, and types,
and has no required dependencies.
Install
npm install @shoppable/checkoutpnpm add @shoppable/checkout<script src="https://developer.shoppable.com/downloads/checkout/latest/shoppable-checkout.global.js"></script>Methods
| Method | Description |
|---|---|
getCartConfiguration() | Fetch cart config; mints + caches the session token. |
getCustomer() | Customer context for the cart. |
lookupProducts(upcs, opts?) | Availability for a list of UPCs. |
prepareCheckout(cart) | Start a checkout. |
createIntent(checkoutId, body?) | Create the Stripe payment intent. |
updateCheckout(checkoutId, patch) | Patch an in-progress checkout. |
completeCheckout(checkoutId) | Finalize after payment. |
validateCoupon(input) | Validate a coupon code. |
lander.getSession(sid) | AI cart lander session context. |
lander.getRecommendations(sid) | AI cart lander recommendations. |
Verifying downloads
Release zips are signed with Sigstore cosign (keyless):
cosign verify-blob \ --certificate checkout-0.1.0.zip.pem \ --signature checkout-0.1.0.zip.sig \ --certificate-identity-regexp 'https://github.com/72Lux/shoppable-developers/.*' \ --certificate-oidc-issuer https://token.actions.githubusercontent.com \ checkout-0.1.0.zip