Subbly.js SDK
Subbly.js is Subbly's browser-side JavaScript library, published on npm as
@subbly/sdk. It calls the Storefront API for you, holds one cart per page,
and keeps the cart ID and the customer's access token in browser cookies.
The library is browser-first. It reads and writes document.cookie directly,
so run it in the browser, not on a server.
In this section
- Install — add the package from
npm or load it from a CDN, then start it with
Subbly.init. - Configure — pass your API key, a cart to load and a customer to authenticate.
- Keep it up to date — pin a version and upgrade on your own schedule.
- Build a checkout — the short path from an empty cart to a paid order.
- Handle errors — read the
codea failed request rejects with. - Run a funnel — show upsell offers before, during and after checkout.
Reference
The Subbly.js SDK reference lists every method, with parameters, return values and examples.
Last modified on