WebWorker

Connect Web Workers with the SDK running on the main thread

Import name: Sentry.webWorkerIntegration

This integration, together with Sentry.registerWorker(), establishes communication between the browser's main thread and one or more WebWorkers. It listens to worker messages from the passed workers and forwards them to the main thread.

Read our Web Worker Guide for more information.

What does this integration do?

This integration listens to a message sent from the worker when it calls Sentry.registerWorker({ self }). The purpose is to sync source map information (debugIds) between the main thread and the worker so that worker errors caught by the main thread SDK are properly mapped to the worker's source code.

Type: Worker | Array<Worker>

The web worker(s) to listen to. Every worker must call Sentry.registerWorker({ self }) to register itself with the SDK.

Adds a worker to the integration, after the integraion was already initialized and added to the SDK. This is useful if you have workers that are initialized at later point in your application's lifecycle. Note that every worker must call Sentry.registerWorker({ self }) to register itself with the SDK.

Was this helpful?
Help improve this content
Our documentation is open source and available on GitHub. Your contributions are welcome, whether fixing a typo (drat!) or suggesting an update ("yeah, this would be better").