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.

The telemetry-wireup skill adds this plugin for you, together with the browser SDK. It adds the plugin only to a production build that has the token, so a missing token or a failed upload never fails the build.

Prerequisites​

  • @tiden/telemetry-browser installed and initialized.
  • A product id.
  • A Tiden API token with full access, available only in CI or build-time secrets. Use a product token with Full access to this product, created in Product settings > API tokens. A publish-only token cannot upload source maps. See API authentication.
  • 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_API_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.