Sourcemaps
For TypeScript/JavaScript projects, configure Sourcemaps to get readable code in stack traces.
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.
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.
![](https://mintlify.s3-us-west-1.amazonaws.com/decipherai/images/sourcemaps-authtoken.png)
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:
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.
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 field | Value |
---|---|
org | "decipher" |
project | "your project name" |
authToken | process.env.SENTRY_AUTH_TOKEN (from the previous step) |
Examples of this are below.
import { withSentryConfig } from '@sentry/nextjs';
/** @type {import('next').NextConfig} */
const nextConfig = {
//... your NextConfig
}
export default withSentryConfig(nextConfig, {
org: "decipher",
project: "my-project-name",
// ...
});
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.