> ## Documentation Index
> Fetch the complete documentation index at: https://docs.aient.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Upload source maps

> Upload JavaScript source maps from CI with @aient/sourcemaps so Aient resolves minified browser stack frames using matching service name and commit SHA.

# Upload source maps

Upload source maps from CI after building your frontend. The upload commit and service name must match the telemetry emitted by the deployed bundle.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
pnpm dlx @aient/sourcemaps upload .next/static \
  --service web \
  --commit "$GITHUB_SHA" \
  --bundle-prefix /_next/static \
  --fail-on-empty
```

Set `AIENT_API_KEY` in CI. Unlike telemetry publishable keys, source map upload keys are server-side credentials and must not be shipped to browsers.

## Matching rules

| Field           | Must match                                            |
| --------------- | ----------------------------------------------------- |
| `service`       | Browser telemetry `service.name`                      |
| `commit`        | Browser telemetry `deployment.commit_sha`             |
| `bundle-prefix` | Public path that appears in minified stack frame URLs |
