Skip to main content

Upload source maps

Use source maps for browser JavaScript so minified production stack traces resolve to original source files in Tiden.

Prerequisites

  • @tiden/telemetry-browser installed and initialized.
  • A product id.
  • A Tiden API token available only in CI or build-time secrets.
  • Production build emits source maps.

Install

npm install -D @tiden/telemetry-sourcemaps

Configure Vite

// vite.config.ts
import { defineConfig } from 'vite'
import { tidenSourceMaps } from '@tiden/telemetry-sourcemaps'

export default defineConfig({
build: { sourcemap: true },
plugins: [
tidenSourceMaps.vite({
url: 'https://app.tiden.ai',
productId: process.env.TIDEN_PRODUCT_ID!,
authToken: process.env.TIDEN_AUTH_TOKEN!,
release: process.env.RELEASE_VERSION!,
filesToDeleteAfterUpload: ['dist/**/*.map'],
}),
],
})

Other bundlers

The package exposes one configuration shape for multiple bundlers:

tidenSourceMaps.webpack(options)
tidenSourceMaps.rollup(options)
tidenSourceMaps.esbuild(options)

Security rules

  • Keep authToken out of browser code.
  • Store the token as a CI secret.
  • Prefer deleting public .map files after upload.
  • Use the same release value in the runtime browser SDK and build plugin.

How upload works

  1. The plugin injects debug IDs into JavaScript bundles and source maps.
  2. It asks Tiden for a presigned upload URL.
  3. It uploads each source map.
  4. It confirms the upload.
  5. Tiden uses debug IDs to symbolicate stack traces at issue view time.

Source maps remain private.