SDKInitOptions.workerUrl
URL to render.worker.js, the prebuilt, self-contained worker bundle the package ships at dist/render.worker.js and exposes via the ./render-worker export subpath. It is an ES module and must be served as a same-origin URL — Web Workers cannot be loaded from bare package specifiers at runtime. Either copy it to your static assets (works with every bundler) or, in Vite, import it with the ?url suffix. The worker takes the engine's bytes from the page and makes no request of its own. Unlike engineUrl, it is not a self-hosting option: any license may set it, since the file is your own copy of one the package ships.
When a workerUrl is provided, page rendering moves off the main thread with no viewer configuration change; performance.workerEnabled: false disables it. The worker renders from a copy of the document: under a production license that includes export with clean output it holds the document as edited; under any other license it holds only the bytes you handed over and is stopped at the first change to the document, after which every page renders on the main thread (see Web worker rendering). Without a workerUrl the worker is never created. Enabling it keeps the engine (~4.4 MB) in memory twice, once on each thread, though it is downloaded only once; the worker also holds its own copy of the document. See Web worker rendering.
Example
// Option B: Vite ?url import (Vite emits the file and returns its URL) import RenderWorkerUrl from '@kernstra/pdf-web-sdk/render-worker?url'; await Kernstra.init({ license: import.meta.env.KERNSTRA_LICENSE, workerUrl: RenderWorkerUrl, }); // Option A: copy dist/render.worker.js to your static assets instead // cp node_modules/@kernstra/pdf-web-sdk/dist/render.worker.js public/assets/render.worker.js // await Kernstra.init({ license: import.meta.env.KERNSTRA_LICENSE, workerUrl: '/assets/render.worker.js' });