Skip to content

Upload source maps

Readable JavaScript stack traces with sentry-cli, bundler plugins or the TypeScript CLI. Only environment variables change.

Readable JavaScript stack traces need your source maps. Supermetry accepts them from the standard Sentry upload tools; only environment variables change.

  1. In the app project, open Settings, Installation, Upload source maps and create an upload token. It can only upload source maps and manage releases for that project, and it already contains your server address and organization, so it is the only secret you set. Copy it once; it is not shown again.

  2. Inject debug IDs and upload with sentry-cli (npm package @sentry/cli).

    Terminal window
    export SENTRY_AUTH_TOKEN=<upload token>
    export SENTRY_PROJECT=<project id>
    sentry-cli sourcemaps inject ./dist
    sentry-cli sourcemaps upload --release <release> ./dist
  3. Or use a bundler plugin. With @sentry/vite-plugin, set url (your server address) and authToken in the plugin options; it injects debug IDs and uploads during the build. Other Sentry bundler plugins take the same options.

  4. Or use the TypeScript CLI (npm package sentry), which reads the same variables: sentry sourcemap inject ./dist and sentry sourcemap upload --release <release> ./dist.

Set the same release in your SDK’s init that you upload. Debug IDs match a frame to its map exactly; without them Supermetry falls back to the release and the file URL.

SENTRY_URL is only needed when you use a plain API key with the releases:write scope instead of an upload token. Set it to your server address without a path.

Each tool is run against a fresh server with a Vite build in headless Chromium, and the upload is checked.

Tool Version
@sentry/cli (Rust sentry-cli) 3.8.2
@sentry/vite-plugin 4.6.1
sentry (TypeScript CLI) 0.49.0

Native debug symbols and minidumps are not processed. See Migrate from Sentry.