This guide will get you all set up and ready to use the BetterCommerce API for Next.js StoreFront. We'll cover how to get started using one of our API clients and how to make your first API request. We'll also look at where to go next to find all the information you need to take full advantage of our powerful REST API.
- Signup with the platform by getting in touch at email@example.com
- You can login and go to Settings > API Keys and copy API Key & Shared Secret.
- You will also need your OrgId & DomainId – which is provided by the BetterCommerce account manager.
- Clone the git repo from BetterCommerce StoreFront
- Update environment variables in .env file - details below.
- Run the solution locally or publish on vercel or any other static site supported hosting providers
You shall be needing the following data to setup your Next.js storefront. The variables prefixed with NEXT_ are exposed to the front end. You need to have NEXT_PUBLIC for it to be accessed on the client side, else these variables are accessible only on the server.
|Identify commerce provider being used in the storefront|
|Base URL for the BC API|
|Auth URL to get API token||https://auth.bettercommerce.io/oAuth/Token|
|API Key||Available in the Settings > API Token|
|API Shared Secret||Available in the Settings > API Token|
|Unique OrgId for your organization||Provided by your BC Account Manager|
|Unique Domain Id per domain within the organization||Provided by your BC Account Manager|
|Version of the API being used|
|Should the infinite scroll be enabled on PLPs or standard paging|
|If Omnilytics is enabled for realtime event capture, then this value to be provided||Your account manager shall provide the link|
|If Omnilytics is enabled for realtime event capture, then this value is needed||Your account manager shall provide the link|
|OMS API Url which is used for fetching basket delivery plan, split shipment, inventory, etc.|
|Used for post code finder, can be left blank as well if loqate is not used||To be fetched by signup with Loqate|