Skip to content

Track your app’s errors with a Sentry SDK, without a Sentry account, from your AI agent

Your app crashes, and you find out from a customer. With while, its errors arrive through a Sentry SDK, with no Sentry account to open, and a never-seen-before error alerts your AI agent, which reads the stack trace and fixes it.

By Aloïs Oddon, co-founder of Nextmap. Facts checked on November 2, 2026.

View as Markdown

Prerequisites

  • An app in Node.js, Python, Go or any other language that has a Sentry SDK.
  • An AI agent that works in a terminal: Claude Code, Codex, Cursor or Gemini CLI.

Step 1: Give your agent these instructions

Open your agent in your app’s folder, and paste these instructions into it:

Instructions
Connect to while with my account (while.sh/agents), then deploy my app.

Your agent adds while’s MCP server itself. If it asks you to, restart it. On the first call to while, a page opens in your browser. In Claude Code, if it doesn’t open, type /mcp, choose while, then Authenticate. On that page, choose “A new app”, then click Authorize.

Step 2: Stop watching for errors

When a never-seen-before error comes in, your agent is notified, reads the stack trace, fixes the code and offers you the new version.

What your agent does

It adds the Sentry SDK to your app and connects it to SENTRY_DSN, which your app already receives1:

instrument.js
import * as Sentry from '@sentry/node';

Sentry.init({ dsn: process.env.SENTRY_DSN });

It loads the SDK before the rest of your app, as Sentry requires:

package.json
"scripts": {
  "start": "node --import ./instrument.js server.js"
}

There is nothing to open at Sentry and nothing to configure in while: the address points to while, and it works even if your app has no internet access, which is the default. Errors are grouped, and each one keeps its stack trace.

Understand what is crashing

You, to your agent: What has been crashing since the last deployment?

Your agent reads the grouped errors in while, finds the line at fault, fixes it and deploys again.

Track browser errors too

You, to your agent: Add the browser errors too.

Your agent connects the Sentry SDK in your pages to SENTRY_DSN_PUBLIC, the address made for the browser.

Connect a Python API

You, to your agent: Hook up error tracking for our FastAPI API.

The Sentry SDK for Python connects the same way, with the same variable:

main.py
import os
import sentry_sdk

sentry_sdk.init(dsn=os.environ.get("SENTRY_DSN"))

Go back to the previous version

You, to your agent: Go back to the previous version.

In the 30 minutes after a deployment, the previous version comes back in a second. After that, it takes a few seconds. Once the previous version is back, your agent reads what broke in while’s logs, fixes it and deploys again.

In the docs: Errors (Sentry) and Versions and rollback.

Next steps

Sources

  1. Sentry, the SDK for Node.js, accessed November 2, 2026

Questions

Do I need a Sentry account?

No. The Sentry SDK sends its errors to while, with no account or subscription at Sentry.

Which languages?

All the ones that have a Sentry SDK: Node.js, Python, Go, Ruby, PHP, Java…

Is my agent notified of every error?

Of a never-seen-before error, yes. An error that is already known is counted, without disturbing your agent every time.

What about my app’s logs?

They are kept in while, for 14 days on the Free plan, and your agent reads them too.

Connect your agent, it takes care of the rest

To paste into your agent

Read while.sh/agents, then deploy my app with while.

Copy the instructions

No account needed to try: your app is live right away. To keep it, sign in.

A project for your company? Talk to the team: hello@while.sh