Skip to content
Console
Menu

Queues

Workflows

Getting Started

Authentication

KV Store

Source maps

One map per release and file, and the frames it turns back into your code

A stack from a bundled application points at the build, not at your code. A Source Map is one uploaded JavaScript source map of one release of a project environment, and captured stack frames of that release whose file matches file_url are mapped back to the original source before the group is chosen. The source_maps collection has every method, its scope and its examples.

#What a map is keyed by

Two fields identify a map, and one of them decides whether a frame finds it.

FieldTypeWhat it is
releasestringThe release the map belongs to, as sent in ErrorEvent.release. Required.
file_urlstringThe minified file the map describes: its URL, or its path. A frame matches on the URL path. Required.
contentstringThe source map JSON (revision 3). Written, never read back. Required.
content_sha256stringSHA-256 of content, hex. Output only.
size_bytesint64Size of content in bytes. Output only.
upload_timetimestampWhen the map was uploaded. Output only.

The map's id is smp_<digest>, and the same release and file always have the same id. That is the whole of the update story: uploading the same release and file again replaces the map, so a rebuild that changed only the bundle needs no cleanup first — the newer upload is the map the frames will be mapped through.

file_url is the minified file the map describes: its URL (https://app.example.com/assets/index-3f2a.js) or its path (/assets/index-3f2a.js). A frame matches on the URL path, so either spelling of the same file finds the map.

#Upload a map

Shell
sylphx observability source-maps create --parent orgs/acme/projects/shop/envs/production --release … --file-url … --content …
Shell
curl -X POST "https://api.sylphx.com/v1/orgs/acme/projects/shop/envs/production/source_maps" \
  -H "Authorization: Bearer $SYLPHX_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"content":"…","file_url":"…","release":"…"}'
TypeScript
const response = await sylphx.observability.sourceMaps.create({ parent: 'orgs/acme/projects/shop/envs/production', sourceMap: { content: '…', fileUrl: '…', release: '…' } })

The release here is the same string the emitter sends as ErrorEvent.release (Errors covers the capture), which is what joins a captured frame to this map. Frames are mapped before grouping runs, so the map belongs in the build that produced the release rather than in the incident afterwards.

One upload per minified file: a release with three bundles has three maps, each matching its own file.

#Read the maps back

A map is a lookup, not an archive: reading one returns its release, its file, its digest and its size, never its content. get and list need observability:read; the upload needs observability:write.

Shell
sylphx observability source-maps list orgs/acme/projects/shop/envs/production
sylphx observability source-maps get orgs/acme/projects/shop/envs/production/source_maps/source-map

The list comes back newest first, and it filters on release alone: the map that a release is missing shows up as a file you upload again, at no risk to the ones already there.