Skip to main content
This guide walks through the end-to-end journey: scaffold the starter template, wire credentials, extend the UI with the Storefront SDK, and fall back to raw REST calls when needed.

1. Scaffold with the CLI

  • Pick the template that matches your brand.
  • Authenticate with the dashboard to generate an API key.
  • Let the CLI install dependencies and open the project.
You now have a fully functional storefront running against real Crave data.

2. Configure environment variables

Copy .env.example to .env.local and provide the values from the dashboard:
Restart the dev server so changes take effect.

3. Use the Storefront SDK

The template exposes a ready-to-use client at src/lib/storefront-client.ts.
Need custom behavior? The SDK exposes granular methods for carts, discounts, analytics events, and more.

4. Implement checkout flows

Use the generated React components or wire up your own screens:

5. Call REST endpoints for non-JS services

If you need to integrate a kiosk, POS, or mobile app, call the same endpoints directly:

6. Deploy

  • Preview – Use Vercel, Netlify, or your preferred hosting to deploy the Next.js app.
  • Secrets – Store API keys using your platform’s secret manager.
  • Monitoring – Forward logs and errors to your observability stack to track storefront health.

Next steps

  • Harden your storefront with custom auth flows or loyalty integrations.
  • Explore analytics events to capture funnel performance.
  • Review the API reference whenever you add new features.