Sourcemaps are a way to convert (minified) JavaScript backtraces such as to something a bit more helpful. A sourcemap contains data about your front-end source code and given the minified file, line number and column number, we can ask a sourcemap for the original function, line/column number and even surrounding source code.


Enhancing backtraces with sourcemaps has one requirement:

  • Each sample needs to tagged with a revision of your application. This is used to determine when to fetch new sourcemaps after a deploy has changed your (front-end) code. You can specify the revision in the options given when creating a new AppSignal instance.
const appsignal = new Appsignal({
  key: "<your frontend API key>",
  revision: "<your current revision>",

Public sourcemaps

With public sourcemaps the sourcemap is hosted next to the (minified) JavaScript file. At the bottom of the minified JavaScript there needs to be a special comment to indicate that a sourcemap is available for the code.


The URL in this comment can either be a full URL or a relative path to the sourcemap. If the URL is relative, we use the file path of the minified source to determine a full URL.

For example, if the minified JS is hosted on: and the sourcemap comment looks like //#, we will attempt to retrieve the source map from the following URL:

Our system has limited caching of public sourcemaps, this means that we can request the minified version and the sourcemap file multiple times after a deploy.

Private sourcemaps

When you don't want to make your sourcemap public, you can upload them to our sourcemaps API endpoint.

Sending sourcemaps

A CURL command would look like this:

curl -k -X POST -H 'Content-Type: multipart/form-data' \
  -F 'name[]=https://test.local/main.abc123.js' \
  -F 'revision=abcdef' \
  -F 'file=@/~project/' \

We match the name[] fields against the full backtrace url e.g. the following backtrace line:

 at https://test.local/main.abc123.js:1:92623\"

Will match with the name: https://test.local/main.abc123.js. You can add multiple name's in one curl request:

curl -k -X POST -H 'Content-Type: multipart/form-data' \
  -F 'name[]=https://test.local/main.abc123.js' \
  -F 'name[]=https://cdn.local/main.abc123.js' \
  -F 'revision=abcdef' \
  -F 'file=@/~project/' \

You can read more about the sourcemap API endpoint on the documentation page.

NOTE: You can only upload one sourcemap file at a time, so if you have multiple sourcemap files, you will have to send an upload request for each file separately. Maximum upload size allowed for sourcemap file is 100MB.


Sourcemaps are grouped into a "release" by the revision string and we will keep the last "release" until a new revision is uploaded. Older "releases" will be kept for up to sixty days.

Need more help?

Contact us and speak directly with the engineers working on AppSignal. They will help you get set up, tweak your code and make sure you get the most out of using AppSignal.

Contact us

Start a trial - 30 days free

AppSignal is a great way to monitor your Ruby, Elixir & Node.js applications. Works great with Rails, Phoenix, Express and other frameworks, with support for background jobs too. Let's improve your apps together.

Start a trial