pnpm run api:startServer default URL: http://localhost:8787
Set these in .env:
SUPABASE_URL=...
SUPABASE_SERVICE_ROLE_KEY=...
API_PORT=8787
BACKEND_API_KEY=optional-secret-keyIf BACKEND_API_KEY is set, send it in header x-api-key.
curl http://localhost:8787/healthcurl -X POST http://localhost:8787/api/user-accounts/upsert \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_BACKEND_API_KEY" \
-d '{
"email": "user@example.com",
"role": "user",
"subscription_status": "trial"
}'curl -X POST http://localhost:8787/api/plugin-usage/log \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_BACKEND_API_KEY" \
-d '{
"user_id": "UUID_FROM_USER_ACCOUNTS",
"extension_version": "1.0.0",
"device_id": "macbook-pro",
"event_type": "usage",
"is_active": true,
"metadata": {"source": "extension"}
}'curl -X POST http://localhost:8787/api/orders-subscriptions/upsert \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_BACKEND_API_KEY" \
-d '{
"user_id": "UUID_FROM_USER_ACCOUNTS",
"amount_usd": 9.99,
"payment_method": "card",
"subscription_status": "active",
"expires_at": "2026-12-31T00:00:00.000Z"
}'To update an existing order, include id in payload.