Skip to main content
Every WaniWani client authenticates with a single API key scoped to one MCP environment. An environment maps to one deployment target, typically one per server and per stage (prod, staging, local).

Create an environment

1

Sign in

Open app.waniwani.ai and sign in.
2

Create an MCP environment

From the dashboard, create a new MCP environment. Name it after the server and stage, for example:
  • my-app-prod
  • my-app-staging
  • my-app-local
3

Copy the API key

Open the environment settings and copy the API key. Keys are prefixed with wwk_ (for example wwk_abc123...) and shown in full only once.
API keys grant rights to ingest events and mint widget tokens for their environment. Treat them as server-side secrets. Never commit them to git, never ship them in client-side bundles.

Configure the key

Set WANIWANI_API_KEY in the environment where your MCP server runs. The SDK reads it automatically when you call waniwani() with no arguments.
.env
WANIWANI_API_KEY=wwk_...
import { waniwani } from "@waniwani/sdk";

const wani = waniwani();
Manage the variable wherever you normally keep secrets (a local .env file, your platform’s secret manager on Vercel, Alpic, Fly, Railway, and so on).

Per-environment keys

Use a separate key per stage. Mixing environments pollutes your metrics and makes rotation harder.
StageEnvironment nameWhere the env var lives
Productionmy-app-prodPlatform secret manager
Stagingmy-app-stagingPlatform secret manager
Local devmy-app-local.env (gitignored)

Rotate a key

Rotate from the environment settings in the dashboard. Clients using the old key start receiving 401 Unauthorized; the SDK’s transport detects auth failures and stops retrying, so you get a clean shutdown instead of a retry storm.

Troubleshooting

If events do not appear in the dashboard:
  1. Confirm WANIWANI_API_KEY is set in the process running the MCP server (setting it only in your shell is not enough).
  2. Check for typos. The key is a single string, no quotes, no trailing whitespace.
  3. Look for [waniwani] lines in your server logs.
  4. Trigger a tool call. The dashboard only shows events from real traffic.

Also supported

Pass the key explicitly when you need multiple clients in one process (multi-tenant setups):
import { waniwani } from "@waniwani/sdk";

const wani = waniwani({ apiKey: process.env.TENANT_A_KEY });
Next: wrap your MCP server.