Upload source maps
Use source maps for browser JavaScript so minified production stack traces resolve to original source files in Tiden.
Prerequisites
@tiden/telemetry-browserinstalled 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
authTokenout of browser code. - Store the token as a CI secret.
- Prefer deleting public
.mapfiles after upload. - Use the same
releasevalue in the runtime browser SDK and build plugin.
How upload works
- The plugin injects debug IDs into JavaScript bundles and source maps.
- It asks Tiden for a presigned upload URL.
- It uploads each source map.
- It confirms the upload.
- Tiden uses debug IDs to symbolicate stack traces at issue view time.
Source maps remain private.