Stack decoder examples
Usage examples for the @roku-sdk/stack-decoder TypeScript API, using the source maps bundled in bundle-dev-example/ and bundle-prod-example/.
Setup
To install the dependencies, run this command from the workspace root:
pnpm installExamples
Every example supports development and production bundles through the BUILD_VARIANT environment variable (defaults to dev).
| Script | Dev | Prod | Description |
|---|---|---|---|
| basic-decode | pnpm basic:dev | pnpm basic:prod | decodeStack with buildDir, with a source map file, SHA auto-detection, and context control |
| error-handling | pnpm errors:dev | pnpm errors:prod | StackDecoderError for invalid options and source maps, unmappable frames, a buildDir that does not exist, and edge cases |
| batch-processing | pnpm batch:dev | pnpm batch:prod | loadSourceMap for cached loading and inline source map reuse across multiple traces |
| sentry-integration | pnpm sentry:dev | pnpm sentry:prod | beforeSend hook: device crash through the frame pipeline of Sentry with context lines |
| bugsnag-integration | pnpm bugsnag:dev | pnpm bugsnag:prod | onError hook: device crash through the frame pipeline of Bugsnag |
Run all examples at once:
pnpm all:dev # Development build (bundle-dev-example)
pnpm all:prod # Production build (bundle-prod-example)API coverage
This table shows which example files use each export:
| Export | Example files |
|---|---|
decodeStack | All examples |
loadSourceMap | batch-processing |
StackDecoderError | error-handling |
DecodeOptions.buildDir | basic-decode, batch-processing |
DecodeOptions.sourceMap | basic-decode, batch-processing, sentry-integration, bugsnag-integration |
DecodeOptions.contextLines | basic-decode, sentry-integration |
DecodeOptions.sha | basic-decode (detected automatically from the trace) |
DecodedFrame | sentry-integration, bugsnag-integration |
Updated about 3 hours ago
Did this page help you?