Configuration
This page defines the production-safe configuration baseline for Storefront API access and MCP integrations.
1) Storefront API Configuration
Set environment variables in your app runtime:
NEXT_PUBLIC_ECOMMAPS_API_URL=https://api.ecommaps.com/api/v1/storefront
ECOMMAPS_API_KEY=sk_eco_your_storefront_key⚠️
Keep API keys out of public repositories and CI logs. Use your deployment platform's encrypted environment variables.
2) Basic SDK Client Setup
import { createEcommapsClient } from "@ecommaps/client";
export const client = createEcommapsClient({
apiUrl: process.env.NEXT_PUBLIC_ECOMMAPS_API_URL!,
apiKey: process.env.ECOMMAPS_API_KEY!,
});3) Customer Authentication Model
- Storefront endpoints require
x-api-key. - Customer account endpoints require
Authorization: Bearer <jwt>. - Keep customer JWT in secure cookies where applicable.
4) AI Runtime Keys (Optional)
Set your model provider key separately from Ecommaps credentials:
OPENAI_API_KEY=your_openai_keyThis separation is mandatory for secure billing and access boundaries.
5) Production Readiness Checklist
- API base URL points to the intended environment.
- Storefront key is valid and scoped to the target store.
- Customer JWT handling is secure.
- Rate-limit and retry strategy exists in your integration layer.
- Observability is enabled for API failures and checkout flow.