How do I add error tracking to a Lovable, Replit or Bolt app?
Report errors from your app's server code, then connect the tracker to the builder's agent. On Lovable, and on Bolt with Supabase, that means one shared file in your Edge Functions. On Replit, it means the Runheed Node.js or Python SDK. Errors in the browser are not captured, because Runheed has no browser SDK yet.
What each builder needs
| Builder | Where server code runs | Report errors with | Where the key goes | Full steps |
|---|---|---|---|---|
| Lovable | Backend functions, on Lovable Cloud (built on Supabase's foundation) or your own Supabase project | A shared file wrapping each function | Lovable Cloud: More > Secrets. Own project: Supabase secrets. Name it RUNHEED_KEY | Lovable |
| Replit | Your Node.js or Python server | The SDK | A Replit secret named RUNHEED_DSN | Replit |
| Bolt with Supabase | Supabase Edge Functions | A shared file wrapping each function | Supabase secret RUNHEED_KEY | Bolt |
| Bolt with Bolt Database | Server functions | A POST to the ingest endpoint (not tested by us) | Your project's secrets, under Backend and credentials | Docs |
The steps
- Create a project in Runheed and copy its DSN. Edge Functions use the pk_... part of it as the key.
- Store it as a secret in the place the table shows. Never paste it into a prompt that writes it into the code.
- Connect the server URL https://runheed.com/api/mcp to the builder as an MCP connector and sign in. Lovable: Connectors > Add custom > MCP server. Replit: replit.com/integrations, under MCP Servers. Bolt: plus icon in the chatbox > Connectors > Manage connectors > Custom MCP server.
- Paste the prompt from your builder's setup page into its chat. It writes the reporting code, throws one test error, confirms it through the connector and removes the test code.
- Ask in the chat: "Using the Runheed connector, list my newest unresolved errors and fix the top one."
On Replit, the code looks like this
terminalbash
npm install https://runheed.com/dl/runheed-0.1.1.tgz
# or, for Python
pip install https://runheed.com/dl/runheed-0.1.1-py3-none-any.whlNode.jstypescript
import runheed from 'runheed';
runheed.init({
dsn: process.env.RUNHEED_DSN!,
environment: 'production',
release: process.env.GIT_SHA, // optional: lets the agent match errors to a deploy
});Pythonpython
import os, runheed
runheed.init(dsn=os.environ["RUNHEED_DSN"], environment="production")For Lovable and Bolt on Supabase, the shared file needs no package because it reports with fetch. It is explained line by line on the Supabase Edge Functions page.
What gets captured
| Failure | Captured? |
|---|---|
| A wrapped Edge Function throws | Yes, with the request. The shared file on the Supabase page also sends the stack trace |
| A Node.js or Python server has an uncaught exception | Yes, automatically once the SDK is initialized |
| Your code catches an error and returns a response | Only if you report it in the catch block |
| A database policy or trigger fails | Only when a function receives the failure and reports it |
| A React component crashes in the browser, or a button handler throws | No. There is no browser SDK yet |
If your app has no server code at all, Runheed has nothing to record yet, and it is not the right tool today.
Questions
- Will the connector ship with my published app?
- On Lovable, no: its docs say chat connectors are personal to you and are never part of your published app. The reporting code does ship, and it only sends errors.
- Can the builder's agent fix the errors itself?
- Once connected, it can list and read errors through Runheed's tools and edit your project as usual. Check the change in your builder before you publish it. Then ask it to resolve the error; if the same error comes back, it reopens on its own.
- Do I need to know how to code?
- Not for the setup. The builder's agent writes the code from the prompt on the setup page. You create the project, store the secret and connect the server.
- What does it cost?
- Plans start at $29/month for 50,000 events a month, 3 projects and 30 days of history. Events over the monthly limit are rejected, never billed.