š§© Connect Your Custom Storefront to Builder.io
Builder.io supports integration with your own custom frontendālike a Next.js appāusing Custom Storefront mode.
This allows you to use Builder as a headless visual editor while fully controlling your storefront implementation.
š§± Step 1: Choose āCustom Storefrontā Mode
- Go to your spaceās Dashboard ā Design**
- Scroll to the Editor Mode section
- Select
Custom Storefront
from the dropdown
š Step 2: Set Your API Key
In the API Key field, enter the public API key that your frontend will use to load Builder content.
You can get this key by:
- Opening your space in Builder
- Going to Settings (āļø) ā API Keys
- Copy the Public API Key
Paste it into the API Key field (it will look like SHOPNEX_API_KEY=...
if youāre using Shopnex).
š” This key is safe to expose in frontend code. Do not use your Private API key here.
š Step 3: Add Storefront URLs (Optional)
In the Storefront URLs field:
- Enter the public URLs where your storefront is hosted
- Press Enter after each one to add multiple
Hereās a clearer and more polished version of Step 4, emphasizing the CLI scaffolding:
āļø Step 4: Scaffold Your Storefront via CLI
Select a design template youād like to use for your storefrontāsuch as Next.js + Tailwind, Shopify-style, or othersāand copy the CLI command provided.
Then, run the command in your terminal to scaffold a preconfigured storefront application:
npx create-builder-storefront@latest ...
This command will:
- Automatically set up a ready-to-use project with Builder integrated in Custom Storefront mode
Once itās installed, follow the instructions in the terminal to start the development server and view your storefront.
š” You can always customize the components, styles, and routing to fit your brand after installation.