openreplay/sourcemap-uploader
Kraiem Taha Yassine 7b6c02a955
Dev (#2288)
* refactor(chalice): upgraded dependencies

* refactor(chalice): upgraded dependencies
feat(chalice): support heatmaps

* feat(chalice): support predefined metric users-count

* feat(chalice): support timeseries of users-count

* refactor(sourcemap-uploader): refactored code
2024-06-21 14:26:18 +02:00
..
lib dev(sourcemap-uploader): upgrade lint dependencies 2021-09-23 19:32:42 +02:00
.eslintrc.json dev(sourcemap-uploader): upgrade lint dependencies 2021-09-23 19:32:42 +02:00
.gitignore feat: init sourcemap-uploader 2021-05-03 17:17:26 +02:00
.npmignore feat: init sourcemap-uploader 2021-05-03 17:17:26 +02:00
cli.js Dev (#2288) 2024-06-21 14:26:18 +02:00
index.js removed console (#1696) 2023-12-04 11:23:30 +01:00
LICENSE MIT license for OpenReplay protocol 2022-08-30 19:04:32 +02:00
package.json fix(sourcemap-uploader):3.0.8: upgrade dependencies 2022-11-29 11:12:41 +01:00
README.md fix(sourcemap-uploader): 3.0.6 - server parameter to the upload functions instead of being global 2021-09-07 13:54:42 +02:00
yarn.lock fix(sourcemap-uploader):3.0.8: upgrade dependencies 2022-11-29 11:12:41 +01:00

sourcemap-uploader

An NPM module to upload your JS sourcemap files to your OpenReplay instance.

Installation

npm i -D @openreplay/sourcemap-uploader

CLI

Upload a sourcemap for one file:

sourcemap-uploader -s https://opnereplay.mycompany.com/api -k API_KEY -p PROJECT_KEY file -m ./dist/index.js.map -u https://myapp.com/index.js

Upload all sourcemaps in a given directory.

The URL must correspond to the root where you upload JS files from the directory. In other words, if you have your app-42.js along with the app-42.js.map in the ./build folder and then want to upload it to your OpenReplay instance so it can be reachable through the link https://myapp.com/static/app-42.js, then the command should be like:

sourcemap-uploader -s https://opnereplay.mycompany.com/api -k API_KEY -p PROJECT_KEY dir -m ./build -u https://myapp.com/static
  • Use -s (--server) to specify the URL of your OpenReplay instance (append it with /api). Do not use this parameter if you use SaaS version of the OpenRplay

  • Use -v (--verbose) to see the logs.

NPM

There are two functions you can export from the package:

uploadFile(api_key, project_key, sourcemap_file_path, js_file_url, [server])
uploadDir(api_key, project_key, sourcemap_dir_path, js_dir_url, [server])

Both functions return Promise with a result value to be the list of files for which sourcemaps were uploaded.