Webpack

Sentry uses releases to match the correct source maps to your events. The release API is intended to allow you to store source files (and source maps) within Sentry.

You can do this with the help of the our Webpack plugin, which internally uses our Sentry CLI.

  1. Create a new authentication token from your [Account] > API keys
  2. Confirm you have project:write selected under "Scopes"
  3. Install @sentry/webpack-plugin using npm
  4. Create .sentryclirc file with necessary configuration, as documented on this page
  5. Update your Webpack config
webpack.config.js
Copied
const SentryPlugin = require("@sentry/webpack-plugin");

module.exports = {
  // ... other config above ...
  plugins: [
    new SentryPlugin({
      release: process.env.RELEASE,
      include: "./dist",
    }),
  ],
};

Learn more about further configuration of the plugin using our Sentry Webpack Plugin documentation.

Additionally, you’ll need to configure the client to send the release:

Copied
Sentry.init({
  dsn: "https://examplePublicKey@o0.ingest.sentry.io/0",
  release: process.env.RELEASE,
});

Learn more about the Releases API documentation.