Grafana Cloud

Upload source maps with cURL

Use cURL to upload source maps in environments where you can’t use Faro JavaScript bundler plugins.

Note

Use the CLI when possible for better handling of file sizes and compression. You can generate ready-to-run cURL commands using faro-cli curl. Refer to CLI.

Before you begin, ensure you have the following:

Build your application with the Faro bundler plugin enabled to add necessary metadata to source maps.

Note

Set skipUpload: true in the bundler plugin configuration to skip uploading during builds while still adding required metadata for manual uploads.

Upload source maps

Create cURL commands to upload source maps directly to the Faro API.

Note

The source map upload endpoint differs from the Faro Collector endpoint. Use the endpoint shown in Frontend Observability > Settings > Source Maps > Configure source map uploads.

shell
curl -X POST \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <stackID>:<apiKey>" \
-d @<filename.js.map> \
https://<your-regions-faro-api-URL>.grafana.net/faro/api/v1/app/<appId>/sourcemaps/<bundleID>

Replace the placeholders:

  • <stackID> - Your Grafana Cloud stack ID
  • <apiKey> - API key with source map upload permissions
  • <filename.js.map> - Path to your source map file
  • <your-regions-faro-api-URL> - API endpoint for your region
  • <appId> - Your application ID
  • <bundleID> - Bundle ID from bundler plugin or custom ID

Note

If you don’t specify a bundleID in the bundler plugin configuration, it’s generated automatically. Retrieve the bundleID from build output or specify your own for automation.

After uploading, verify your source maps in Frontend Observability by navigating to Settings > Source Maps. For troubleshooting common issues, refer to Troubleshooting.