PopularGetting Started
Setup with AI Assistants
Copy and paste this prompt into Cursor, Windsurf, Claude Code, or ChatGPT to automatically integrate NotLogs into your codebase.
Copy-Paste Prompt
Paste this prompt directly into your AI coding assistant:
Set up NotLogs in this project. Work through the phases in order. Stop and wait for me wherever it says to.
────────────────────────────
PHASE 0 — Assess current state (change nothing)
────────────────────────────
Check all of the following:
a. Is a NotLogs SDK (notlogs | @notlogs/nest | @notlogs/next | @notlogs/react) in package.json?
b. Is NOTLOGS_API_KEY present and non-empty in the .env / .env.local file?
c. Is NOTLOGS_API_URL set? (needed for production)
d. Is the SDK wired up in code (logger created / module imported)?
Pick a mode and explain why:
FRESH (nothing set up) | RESUME (partially done) | UPDATE (already working)
────────────────────────────
PHASE 1 — Detect Framework & Install SDK
────────────────────────────
- Next.js (App Router, has app/ dir) → npm install @notlogs/next
- NestJS (@nestjs/core in deps) → npm install @notlogs/nest
- Express.js / plain Node.js → npm install notlogs
- React SPA (Vite / CRA) → npm install @notlogs/react
Detect package manager from lockfile: pnpm | yarn | bun | npm
────────────────────────────
PHASE 2 — Read the official guide for the framework
────────────────────────────
Fetch and read BEFORE writing any code:
- Next.js → https://notlogs.site/docs/agents-docs/nextjs.md
- NestJS → https://notlogs.site/docs/agents-docs/nestjs.md
- Express → https://notlogs.site/docs/agents-docs/expressjs.md
- React → https://notlogs.site/docs/agents-docs/react.md
Also fetch:
- https://notlogs.site/docs/agents-docs/conventions.md
- https://notlogs.site/docs/agents-docs/examples.md
────────────────────────────
PHASE 3 — Environment & API Key
────────────────────────────
Skip if NOTLOGS_API_KEY is already set. Otherwise:
1. Guide me to https://notlogs.site/sign-up to create an account and get an API key.
2. Add to .env (or .env.local for Next.js):
NOTLOGS_API_KEY=SEL_your_key_here
NOTLOGS_API_URL=https://api.notlogs.site/api/v1
3. Verify the env file is in .gitignore.
Ask me to reply "done". STOP and wait.
────────────────────────────
PHASE 4 — Wire Up Logger & Send Probe
────────────────────────────
Wire up exactly as shown in the guide fetched in Phase 2.
Use the project name from package.json as appName.
Send ONE probe event after wiring:
level: "info", message: "NotLogs connected", operation: "setup.verify"
STOP and confirm the probe appears at https://app.notlogs.site/live-logs.
────────────────────────────
PHASE 5 — Propose & Instrument Events
────────────────────────────
Rules (from the conventions doc):
- NEVER log passwords, tokens, full JWTs, or credit card numbers.
- Use track.userId and track.requestId wherever request context is available.
- Use "audit" level for security actions, "metric" for performance.
- Use dot-notation operations: auth.login, payment.charge, order.create.
Scan for: auth flows, payments, API handlers, DB queries, background jobs,
webhooks, global error handlers.
Write a plan table (location | level | message | operation | fields).
Show me the table and STOP. On "approve", instrument cleanly without changing business logic.Using Cursor / Windsurf
Open the Cursor Composer (Cmd+I or Ctrl+I), paste the prompt above, and let the AI generate the logger configuration and instrument your API endpoints automatically.
Using Claude / ChatGPT
Paste your route handlers along with the prompt above to receive tailored, type-safe logging middleware for your project.