Quickstart
-
Install the SDK
Terminal window npm install @shoppable/checkout -
Initialize with your publishable token
import { ShoppableCheckout } from "@shoppable/checkout";const checkout = new ShoppableCheckout({ token: "pk_live_…" }); -
Run the checkout flow
const config = await checkout.getCartConfiguration();const products = await checkout.lookupProducts(["012345678905"]);const order = await checkout.prepareCheckout(cartContent);const { clientSecret } = await checkout.createIntent(order._id);// Confirm `clientSecret` with Stripe.js, then:await checkout.completeCheckout(order._id);
The SDK handles the session token for you — see Authentication for how the two-token model works.