Skip to content

Migrate from Sentry to Belvador

Replace an existing Sentry SDK with the matching Belvador package without reporting errors twice.

Markdown
On this page

Belvador speaks the same protocol as Sentry, so moving an app over is mostly swapping a package and a DSN. The one rule that matters: only one SDK may report errors — run both and every error arrives twice.

Pick the replacement#

You haveReplace withGuide
@sentry/browser@belvador/browserBrowser
@sentry/react@belvador/reactReact
@sentry/tanstackstart-react, or Sentry wired by hand in TanStack Start@belvador/tanstack-startTanStack Start
@sentry/cloudflare@belvador/cloudflareCloudflare Workers
@sentry/nodekeep it, change the DSN and add the scrubbing hookNode.js
sentry-sdk (Python)keep it, change the DSN and add the scrubbing hookPython
Another Sentry SDKkeep it and change the DSN — not verified by Belvador—

Steps for JavaScript apps#

  1. Create a project in Belvador and copy its DSN.

  2. Install the Belvador package, pinned to 0.6.1.

  3. Replace imports. The common functions have the same names:

TypeScript
// Beforeimport * as Sentry from "@sentry/react";Sentry.captureException(error);// Afterimport { captureException } from "@belvador/react";captureException(error);
  1. Replace Sentry.init with Belvador's init (or withBelvador on Workers), using the setup from the guide. Remove the old Sentry.init call — Belvador's init does not take over a client that is already running.

  2. Remove every @sentry/* SDK package from package.json (keep @sentry/cli if CI uses it for source maps). Belvador's packages bring their own pinned engine; installing @sentry/* next to them is not needed.

  3. Update CSP: replace Sentry's ingest host with https://ingest.belvador.dev in connect-src.

  4. Point CI at Belvador for source maps: keep sentry-cli, change SENTRY_URL and the token — see Source maps.

  5. Deploy and verify: run the connection check for each runtime and confirm the Connection tab says Verified. A tagged error works with any Sentry SDK, so you can check before switching packages. Then confirm a real error appears once.

Options that change#

Sentry optionIn Belvador
dsn, release, environment, dist, sampleRate, ignoreErrors, beforeSend, beforeBreadcrumb, maxBreadcrumbs, debugSame meaning
allowUrls, denyUrls (browser)Same meaning
enabledUse disabled: true
integrations, defaultIntegrationsNot accepted; Belvador sets up what it needs. Breadcrumbs are turned on with instrument
tracesSampleRate, tracePropagationTargets, replaysSessionSampleRate, profilesSampleRate, enableLogsNot available — the SDKs send errors only. Send traces and logs with OpenTelemetry; link errors across tiers with tracePropagation
sendDefaultPiiAlways off
tunnel, transportNot available — events go only to your DSN
maxValueLengthFixed at 8,192 characters

TypeScript points out options that no longer exist.

Behaviour that changes#

  • setUser keeps only id. Emails, usernames and IP addresses are removed before sending.

  • Automatic breadcrumbs (console, clicks, fetch, XHR, navigation) are off until you turn them on.

  • Attachments are dropped unless attachments: true.

  • Sentry.showReportDialog and the boundary's showDialog are not available.

  • Request bodies, cookies and auth headers are removed by the SDK and again by your node.

Keeping an existing Sentry SDK#

Any Sentry SDK can send to a Belvador DSN, so you can also just change the DSN. You then keep that SDK's own defaults: it may send tracing data (dropped by your node and counted as Not supported yet), personal data if sendDefaultPii is on, and automatic breadcrumbs. Your node still scrubs before storing. For JavaScript apps the Belvador packages are the safer choice.

Existing issues#

Belvador starts with an empty history: issues and events already in Sentry are not imported. Keep Sentry read-only for a while if you need to look things up.

Posts on this topic

All posts

Spotted something wrong or missing? Tell us: hello@belvador.dev