Docs

API Keys

API keys authenticate your events. Each project has its own key — keep it server-side and in environment variables.


Finding your key

Each project has one API key. Find it in your dashboard under Project Settings → API Key. Copy it and store it in your environment.

Store it safely

Never commit your API key to source control. Add it as an environment variable:

bash
# .env (git-ignored)
LOGIT_API_KEY=lk_live_xxxxxxxxxxxxxxxx
ts
// SDK
import { init } from "logit";
const logit = init({ token: process.env.LOGIT_API_KEY! });

// REST API header
"Authorization": `Bearer ${process.env.LOGIT_API_KEY}`

Warn: API keys have full write access to your project. Never expose them in browser-side code or client bundles. Always call LogIt.Now() from your server or backend.

Rotating keys

If a key is compromised, go to Project Settings → API Key → Regenerate. The old key is immediately invalidated. Update your environment variables and redeploy.