# Configure Subbly.js

`Subbly.init` takes your Storefront API key, and optionally a cart to load and a
customer to authenticate. For every field, see
[`Subbly.init(config)`](/reference/subbly-sdk/setup#init).

```js title="Start with a cart and a customer"
const subbly = await Subbly.init({
  apiKey: 'API_KEY',
  cartId: 'aaea067c-6364-4157-82e9-71b6edfd84a0',
  loadCart: true,
  accessToken: 'eyJh...eyJ9',
})
```

With `loadCart: true`, the SDK loads the cart named by `cartId` or by the
`subbly_cart_id` cookie, creates a new one when there is none, and copies the
cart currency onto the instance.

Your Storefront API key is in the Subbly admin, under Settings, Developers.

## Next steps

- [Build a checkout](/developer-resources/subbly-js-sdk/build-a-checkout) —
  from an empty cart to a paid order.
- [Setup reference](/reference/subbly-sdk/setup) — `Subbly.init`, `VERSION`
  and the instance properties.
