Public API setup
Configure the API origin, merchant slug, and location ID without a browser
credential.
Use the CLI
Inspect one of the current legacy public storefront examples locally.
Existing app
Add the SDK, shared UI dependencies, and component source to an app you
already own.
Project structure
See where components, API helpers, and shared utilities should live.
Use the CLI
The released CLI 1.x can clone one of the current legacy public examples and write its public storefront settings. These examples do not define the current production SDK or component contract and require migration and review before deployment.Existing app
For an existing React or Next.js app, install the SDK first:components directory and keep the SDK transport, ordering state, and presentation boundaries explicit.
Project structure
Use a structure that keeps UI, data access, and ordering state separate:Configure the SDK
Create a shared Storefront SDK client and import it from your data loaders, hooks, or server actions. Get the published location ID and merchant slug from Crave Business Manager. Configure the public API origin explicitly.getAuthToken from the active Clerk session with
the crave-customer token template. Clerk owns token persistence and refresh;
do not store the JWT in application storage. getMerchantSlug is required for
customer operations so Crave can route the same Clerk diner to the correct
restaurant organization.
Add the required environment variables:
Import components
Crave component docs use local imports so you can customize the implementation:Next steps
Components Overview
Browse the full component catalog.
Storefront SDK
Configure the typed API client used by the components.
Display Menu
Fetch menu data and render categories, products, and modifiers.
Manage Cart
Wire cart creation, item updates, discounts, and checkout handoff.
