# 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](/developer-resources/subbly-js-sdk/install) — add the package from
  npm or load it from a CDN, then start it with `Subbly.init`.
- [Configure](/developer-resources/subbly-js-sdk/configure) — pass your API
  key, a cart to load and a customer to authenticate.
- [Keep it up to date](/developer-resources/subbly-js-sdk/keep-it-up-to-date)
  — pin a version and upgrade on your own schedule.
- [Build a checkout](/developer-resources/subbly-js-sdk/build-a-checkout) —
  the short path from an empty cart to a paid order.
- [Handle errors](/developer-resources/subbly-js-sdk/handle-errors) — read the
  `code` a failed request rejects with.
- [Run a funnel](/developer-resources/subbly-js-sdk/run-a-funnel) — show
  upsell offers before, during and after checkout.

## Reference

The [Subbly.js SDK reference](/reference/subbly-sdk) lists every method, with
parameters, return values and examples.
