Private sourcemaps are a premium feature available on the Business Plus and Enterprise plans.
Benefits of private sourcemap uploads
Uploading private sourcemaps to Airbrake:
- Provides a more accurate picture of the error and faster debugging times
- Gives you all of the debugging benefits of publicly hosted sourcemaps without exposing your source code
uglifyjs app.js -o app.min.js -c -m \ --source-map "root='https://example.com/',url='app.min.js.map'"
This command will create two new files, a minified
app.min.js file and a
app.min.js.map. The sourcemap file is what we will be
uploading to Airbrake.
Continuing on with our above example, the next steps assume the minified version
app.js is publicly available at
The bottom of the
app.min.js file should have a comment with the name of the
of the sourcemap.
Upload your sourcemap
The following curl command assumes that your sourcemap file
in the current directory and will upload your sourcemap to airbrake.
curl https://airbrake.io/api/v4/projects/PROJECT_ID/sourcemaps \ -X POST \ -H 'Authorization: Bearer PROJECT_API_KEY' \ -F firstname.lastname@example.org \ -F name="https://example.com/app.min.js.map"
PROJECT_API_KEY will need to be switched out for the real
values from your project.
For your private sourcemap upload to function correctly it’s important you check that:
namefor the file
https://example.com/app.min.js.mapshould be fully qualified.
app.min.jsfile has the
sourceMappingURLcomment at the bottom of that file, e.g.
We also support public sourcemaps please visit our official airbrake-js repo for more info.