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.
- Create a new authentication token from your [Account] > API keys
- Confirm you have
project:write
selected under "Scopes" - Install
@sentry/webpack-plugin
usingnpm
- Create
.sentryclirc
file with necessary configuration, as documented on this page - 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,
});
You don't have to use RELEASE
environment variables. You can provide them in any form as long as the release
from your upload matches release
from the SDK's init
call.
Learn more about the Releases API documentation.
- Package:
- npm:@sentry/react
- Version:
- 8.24.0
- Repository:
- https://github.com/getsentry/sentry-javascript