MARGOVIA_API_KEY when you are ready to send events to Margovia Cloud. Set MARGOVIA_BASE_URL only for local development, self-hosting, or a compatible receiver.
What the SDK captures
- AI workflow or feature name
- User, customer, and account identifiers
- Customer plan and plan revenue
- Provider and model
- Token usage, cache usage, and reasoning tokens
- Manual or provider-reported cost
- Outcomes and business value
Where it runs
Use the SDK in backend code only:- Next.js route handlers and server actions
- Express, Fastify, Hono, and Remix actions
- Worker queues and background jobs
- Internal tools that call model providers
MARGOVIA_API_KEY is a backend secret.