Skip to content

Feature request: upload the same sourcemap artifacts to multiple Sentry instances (multiple url/authToken targets) #868

@Pavel-Liteiniy

Description

@Pavel-Liteiniy

Problem

@sentry/webpack-plugin currently supports:

  • multiple projects (project: string[]) for the same Sentry instance
  • a single url + a single authToken

For teams that must upload the same build artifacts to multiple self-hosted Sentry instances (for example, staging + production instances with different base URLs and tokens), this becomes hard to do with the plugin alone.

Why this matters

A naive approach is to configure two plugin instances with different url/authToken.
In practice this can lead to double processing/injection of the same output files and can affect sourcemap mapping quality.

Current workaround:

  1. keep one plugin instance only for injection (sourcemaps.disable: "disable-upload"),
  2. upload artifacts to each target instance in CI with sentry-cli sourcemaps upload.

This works, but it moves core plugin use-cases into custom CI scripting.

Feature request

Please support uploading to multiple Sentry instances in a single plugin configuration, e.g.:

sentryWebpackPlugin({
  org: 'my-org',
  project: 'my-project',
  release: { name: process.env.RELEASE_VERSION },
  sourcemaps: { assets: ['build/**/*.js', 'build/**/*.map'] },
  uploadTargets: [
    { url: 'https://sentry-staging.example.com', authToken: process.env.SENTRY_AUTH_TOKEN_STAGING },
    { url: 'https://sentry-prod.example.com', authToken: process.env.SENTRY_AUTH_TOKEN_PROD },
  ],
})

Expected behavior

  • Build artifacts are injected/processed once.
  • The same artifacts are uploaded to each configured target.
  • Optional per-target overrides (if needed): org, project, headers.
  • Works with self-hosted instances as well.

Alternatives considered

  • Two plugin instances (one per target): can cause double artifact processing.
  • CI-only uploads via sentry-cli: works, but duplicates plugin logic in CI and adds maintenance overhead.

Environment

  • @sentry/webpack-plugin: 4.9.0
  • Sentry self-hosted: 23.6.2

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions