@malleon/replay-cli
v1.0.3
Published
CLI tool for uploading source maps to Malleon
Readme
@malleon/replay-cli
CLI tool for uploading source maps to Malleon Replay.
Malleon: malleon.io — CLI documentation — npm: @malleon/replay-cli
Installation
npm install -g @malleon/replay-cliUsage
replay-cli upload \
--app-id <your-app-id> \
--token <your-source-map-token> \
--url <your-app-url> \
[--release <release-version>] \
[--dist <dist-identifier>] \
[--source-map-dir <directory>] \
[--include <glob-pattern>] \
[--exclude <exclude-pattern>] \
[--server <server-url>]Required Options
--app-id: Your app ID (found in the Malleon Replay dashboard)--token: Source map token (generate/regenerate in app settings)--url: Your application URL (e.g.,https://myapp.com). This should match the URL where your app is deployed (the same URL that appears inwindow.location.hrefwhen replays are recorded). Used for matching source maps to replays from the correct deployment. If you have multiple deployments (e.g., staging vs production), use the specific URL for each.
Optional Options
--url-pattern: POSIX regex pattern for URL matching (defaults to exact match of provided URL). Use this to match multiple URLs. Example:"https://myapp\\.com/app/.*"to matchhttps://myapp.com/app/,https://myapp.com/app/v1/, etc.--release: Release version (e.g.,1.0.0)--dist: Distribution identifier--source-map-dir: Directory containing source maps (default:.)--include: Glob pattern(s) for source map files (default:**/*.map)- Can be specified multiple times:
--include "**/*.map" --include "**/*.js.map" - Multiple patterns are combined (union)
- Can be specified multiple times:
--exclude: Glob pattern(s) to exclude from upload- Can be specified multiple times:
--exclude "**/node_modules/**" --exclude "**/*.test.map" - Exclusions are applied to all patterns
- Can be specified multiple times:
--server: Internal. You will not need to change this. Replay server URL (default:https://malleon.io)
Examples
Basic upload:
replay-cli upload \
--app-id 550e8400-e29b-41d4-a716-446655440000 \
--token abc123def456... \
--url https://myapp.com \
--release 1.2.3 \
--source-map-dir dist/browserApp deployed at subpath:
replay-cli upload \
--app-id 550e8400-e29b-41d4-a716-446655440000 \
--token abc123def456... \
--url https://myapp.com/app/ \
--release 1.2.3Multiple patterns:
replay-cli upload \
--app-id 550e8400-e29b-41d4-a716-446655440000 \
--token abc123def456... \
--url https://myapp.com \
--include "**/*.map" \
--include "**/*.js.map" \
--source-map-dir distWith exclusions:
replay-cli upload \
--app-id 550e8400-e29b-41d4-a716-446655440000 \
--token abc123def456... \
--url https://myapp.com \
--include "**/*.map" \
--exclude "**/node_modules/**" \
--exclude "**/*.test.map" \
--exclude "**/vendor/**"Getting Your Source Map Token
- Log into the Malleon Replay dashboard
- Navigate to Apps → Select your app → App Details
- Click "Generate Source Map Token" or "Regenerate Source Map Token"
- Copy the token and use it with the
--tokenoption
Important: Keep your source map token secret. Anyone with this token can upload source maps to your app.
