app.aiql.io/api/embed/tokens, then the client fetches that token from your own route (default /api/aiql).
@aiql.io/react/server is a React-free entry point safe to import in Next.js route handlers, Express, or any Node runtime.
Security model
- Store
AIQL_API_KEYandAIQL_WORKSPACE_IDas server env vars. - Expose a same-origin endpoint (for example
GET /api/aiql). - The handler calls AiQL with
Authorization: Bearer <API_KEY>and returns{ token, expiresAt, expiresIn }to the browser. useTokenreads that response and passes the JWT intoAiqlProvider.
Environment variables
Import
Next steps
See Handlers for one-line Next.js and Express setup, plus the coremintWorkspaceToken API.