Skip to main content
Use dedicated development credentials and mockable SDK clients to test your storefront integration before connecting a live restaurant workflow. This guide covers safe API-key usage, Stripe test payments, and example test suites.

Test mode

Use a dedicated development API key for local work. Production dashboard keys are prefixed with crv_live_; Crave-provisioned test environments issue keys prefixed with crv_test_.
When you are working against a Crave-provisioned test environment, test mode behaves like production with these differences: Generate a test API key from Crave Dashboard > Developers > API Development > Step 1 - API Keys. If your organization does not have a test merchant or crv_test_... key available, ask the Crave team to provision one before testing order placement.

Test Stripe payments

In test mode, Crave automatically uses Stripe’s test environment. Use Stripe’s test card numbers: Use any future expiry date and any 3-digit CVC.

Unit testing the SDK

The SDK accepts a custom fetch implementation, making it easy to mock API responses in tests:

Test error handling

Verify your app handles API errors correctly:

Integration testing

For integration tests against the real API, use your test API key and clean up after each test:

Testing webhook handlers

Send mock webhook payloads to your local handler:

Next steps

Error Codes

Handle every error the API can return.

Deployment

Deploy your storefront to production.