> Deprecated:
> The JS Buy SDK is deprecated as of January, 2025. For existing users of JS Buy SDK, we will be releasing a last and final major version 3.0 to remove the SDK’s dependency on the deprecated Checkout APIs and replace them with Cart APIs. Updating to v3.0 will allow merchants to maintain their current setup for most use cases but we will not be maintaining this library after v3.0. We recommend exploring [one of our other solutions](https://shopify.dev/docs/storefronts/headless/building-with-the-storefront-api/getting-started) or consider if one of our [themes](https://themes.shopify.com/) for an Online Store is a better fit for your long-term needs.

The JavaScript (JS) Buy SDK is a lightweight library that lets you add commerce to any website. It's based on Shopify's [Storefront API](/docs/api/storefront) and provides the ability to retrieve products and collections from your store, add products to a cart, and check out.

## Requirements

- You've created a [development store](/docs/api/development-stores) or have a production store.
- You've created [products](/docs/api/storefront/reference/products/product) or [collections](/docs/api/storefront/reference/products/collection) in your store.
- You have experience writing JavaScript. The JS Buy SDK tool is intended for use by developers who are experienced with JavaScript.
- You have a website and want to add commerce functionality to it.

## Step 1: Generate an access token

To generate an access token, you can [generate one in the Shopify admin](/docs/apps/build/authentication-authorization/access-tokens/generate-app-access-tokens-admin). Alternatively, you can create a custom app and use [authorization code grant](/docs/apps/build/authentication-authorization/access-tokens/authorization-code-grant).


## Step 2: Make your products and collections available

After you've generated an access token, you need to make products and collections available to your custom app to access them from your app. After the products and collections are available, you can retrieve them using their respective IDs.

> Tip:
> If you have many products or collections, then you can use [bulk actions](https://help.shopify.com/manual/shopify-admin/productivity-tools/bulk-actions) to make them available in one step.

### Make a product available

1. From your Shopify admin, go to **Products**.
2. From the **Products** page, click the product you want to make available.
3. Next to **SALES CHANNELS AND APPS** click **Manage**.
4. In the **Sales channels and apps** dialog box, select the box next to the name of your custom app.

### Make a collection available

1. From your Shopify admin, go to **Products** and click **Collections**.
2. From the **Collections** page, click the collection you want to make available.
3. Next to **SALES CHANNELS AND APPS** click **Manage**.
4. In the **Sales channels and apps** dialog box, select the box next to the name of your custom app.


## Step 3: Access the JS Buy SDK

The JS Buy SDK can render data on the client side or server. Using the JS Buy SDK, you can do the following:

- Fetch information about a single product or a collection of products
- Create a shopping cart
- Allow customers to select options and quantities
- Generate a checkout URL for a single product or an entire cart

<a href="https://shopify.github.io/js-buy-sdk/" class="marketing-button marketing-button--small">View the JS Buy SDK on GitHub</a>

## Where to get help

This SDK isn't supported by Shopify support, but there are other places where you can get help.

### [Open a GitHub issue](https://github.com/Shopify/js-buy-sdk/issues)

You can open an issue in the GitHub repository.

### [.dev Community](https://community.shopify.dev)

Visit our forums to connect with the developer community and learn more about the Shopify API and app development.

### [Hire a Shopify Partner](https://www.shopify.com/partners/directory)

Find a Shopify Partner for hire in our ecosystem of talented development agencies.