# Source maps

Upload your source maps so production stack traces symbolicate back to the code you wrote.


Production bundles are minified, so a raw stack trace reads like gibberish. Upload your source maps and Everock can resolve supported matching frames back to the original file and line. Correct release IDs, served-file URLs, and available maps are required.

## Upload after each build

Install the build executable in the application that uploads maps:

```bash
npm install -D @everock/sdk
```

The `everock-sourcemaps` CLI finds the `.js.map` files your bundler emitted and ships them, keyed by release. Add it to your build script:

```json title="package.json"
"scripts": {
  "build": "next build && pnpm exec everock-sourcemaps"
}
```

## Configure



### Set the secret key

Uploading uses your **secret** key (`ik_…`), never the public one. Keep it in server and CI environments only.

```bash title=".env (CI)"
EVEROCK_API_KEY=ik_your_secret
```

### Provide a release

The maps are stored per release so a stack from that build resolves against the right code. On Vercel and Cloudflare the commit SHA is detected automatically; otherwise set `EVEROCK_RELEASE`.

```bash
EVEROCK_RELEASE=$(git rev-parse HEAD) pnpm exec everock-sourcemaps
```



## Build directory

The CLI auto-detects the output and the URL each minified file is served at — `.next` (served under `/_next`), `dist`, or `build`. Override it when needed:

```bash
pnpm exec everock-sourcemaps --dir dist/assets --url-prefix /assets --release v1.4.2
```


  With no secret key or no release, the CLI skips quietly and exits 0, so it can never fail a build.



  Once uploaded, matching frames on subsequent errors can be symbolicated on ingest, so incident evidence shows `app.tsx:42` instead of `chunk.abc.js:1:90210`.


Framework setup: [Next.js](/docs/sdks/nextjs) · [Vite](/docs/sdks/vite).
