Configuring sourcemaps is optional, but strongly recommended to enhance debuggability.

If your project is using TypeScript/JavaScript, production code will likely be minified/bundled when deployed. To ensure that your error stack traces have readable code, you’ll need to make sure sourcemaps get sent to Decipher.

1

Get your auth token

On the Organization Settings Page, find your project in the “Your Projects” section. Copy your Auth Token to use in the next step.

2

Set environment variables

Set the environment variables SENTRY_AUTH_TOKEN and SENTRY_URL as below.

If you are already using a file like .env.sentry-build-plugin, update these values there, otherwise set them however you currently configure your CI/CD pipeline.

The SENTRY_AUTH_TOKEN is the token you copied from above. Example:

.env.sentry-build-plugin
SENTRY_AUTH_TOKEN=sntrys_ey...
SENTRY_URL=https://proxy.getdecipher.com

If your project is deployed on Vercel, you may set these environment variables within the “Settings” page of your Vercel project.

3

Configure Sourcemap Upload

Follow the Sentry Sourcemap uploading docs to configure Sourcemap upload for your project. If you don’t have a Sentry account, we recommend following the manual steps (example).

Use the following options in your configuration:

Config fieldValue
org"decipher"
project"your project name"
authTokenprocess.env.SENTRY_AUTH_TOKEN (from the previous step)

Examples of this are below.

next.config.[m]js
import { withSentryConfig } from '@sentry/nextjs';
/** @type {import('next').NextConfig} */

const nextConfig = {
    //... your NextConfig
}

export default withSentryConfig(nextConfig, {
    org: "decipher",
    project: "my-project-name",
    // ...
});        
4

That's it! Now test the configuration by building your app

If you’ve followed the steps above fully, whenever your application is built (on production or locally, e.g. via npm run build), Sourcemaps will automatically be sent to Decipher and production stack traces will have readable code.