Installation
Install and initialize @oleq-ai/logs
Package: @oleq-ai/logs on npm.
Works in JavaScript and TypeScript (Node 18+, NestJS, Next.js server code). Ships ESM + CJS and .d.ts typings.
App name required
Create an app under Apps in the dashboard. Pass the same string as appName when constructing OleqLog.
1. Install the package
bun add @oleq-ai/logsOptional entry point (same install):
@oleq-ai/logs/pino— Pino worker transport (peer:pino)
2. Create an API key
- Sign in with GitHub and create an org if needed.
- Open Apps → Create app (this name becomes
appName). - Open API Keys → Generate New Key. Copy the secret once (
sk_live_…).
3. Set the environment variable
export OLEQLOG_API_KEY=sk_live_…In Next.js / NestJS, put the same value in .env (server-side only):
OLEQLOG_API_KEY=sk_live_…4. Initialize the client
import OleqLog from "@oleq-ai/logs";
const log = new OleqLog({
appName: "my-app", // required — same as Apps
environment: "production",
});That is enough when OLEQLOG_API_KEY is set. Pass options when you need to override:
const log = new OleqLog({
appName: "my-app",
apiKey: "sk_live_…", // optional if env is set
baseUrl: "http://localhost:3000", // local / custom API
environment: "production",
});Next: Usage