whoopsie

Add whoopsie to your AI app.

Pick where you build. Copy the prompt. Paste it into your AI builder's chat. It edits the code for you. No terminal needed (if you have one, there's a faster path further down).

The prompt defaults to standard mode: full prompts, completions, tool args, and reasoning text — with emails, phone numbers, SSNs, card-shaped numbers, JWTs, and provider API keys regex-scrubbed before egress, then scrubbed again server-side. Need zero text off-machine? Flip to redact: "metadata-only". Full data-handling story: /privacy.

Open your Lovable project, click the chat with the AI, paste the prompt below.

After install, verify a trace lands

AI builders sometimes accept the install prompt confidently and then write the wrap incorrectly — silently. The cure is one quick check: send one chat messagein your running app and confirm a trace appears on your live dashboard within ~2 seconds. If nothing lands, the AI rewrote the wrap into something that doesn't invoke whoopsie's middleware. Re-paste the prompt and ask it to use the observe() helper exactly as written.

Lovable is a special case: it builds on TanStack Start (React 19 + Vite), not Next.js. The integration code path is different, and our tests have shown it's the most likely platform to silently no-op. Verify carefully there.

Or: skip the AI builder, install via terminal

If your AI builder refuses (some defended ones will, see above) or you just want to wire it yourself, the npm path works the same:

# in your Next.js + AI SDK project
npx -y @pisama/cli init

# or manually:
pnpm add @pisama/sdk
# then wrap your model in one call:
#   import { observe } from "@pisama/sdk";
#   const model = observe(openai("gpt-4o"), { redact: "metadata-only" });

Set WHOOPSIE_PROJECT_ID=ws_Aa7vHVvLAPcPDNPS in your .env.local.

Why this works (when it works)

Lovable, Replit, Bolt, and v0 all let you talk to an AI that edits your code. The prompt above tells that AI exactly what to do: install the SDK, find the model call, wrap it. The wrap is one line of TypeScript that catches loops, hallucinations, and cost spikes and streams them to your dashboard.

Some AI builders (Lovable in particular) defend against installing new packages with low adoption — that's a feature, not a bug. If yours refuses, the terminal path above still works.