Skip to content

feat(csr): add worker self-hosting helpers - #432

Open
nicklasl wants to merge 6 commits into
mainfrom
nicklasl/csr-worker-framework-guides
Open

feat(csr): add worker self-hosting helpers#432
nicklasl wants to merge 6 commits into
mainfrom
nicklasl/csr-worker-framework-guides

Conversation

@nicklasl

Copy link
Copy Markdown
Member

Summary

  • add a cross-platform confidence-copy-worker command with stale-copy checking
  • document the tested Vite asset URL integration
  • document Next.js public asset and App Router integrations
  • cover base paths, static exports, caching, and Vite asset inlining

This is stacked on #412 and should be reviewed after it.

Validation

  • yarn install --immutable
  • yarn build:csr
  • yarn test:csr (140 tests)
  • yarn workspace @spotify-confidence/session-recording typecheck
  • repository-pinned Prettier check
  • isolated Vite development and production builds
  • isolated Next.js production builds and HTTP checks for both documented approaches
  • CLI package-manager checks with npm, pnpm, and Yarn PnP

nicklasl and others added 6 commits August 17, 2026 13:05
- Add `workerUrl` to `InitSessionRecorderOptions`, plumbed to
  `createUploader`.
- Export `workerScript` from `@spotify-confidence/session-recording/worker`
  so customers can serve it at a same-origin route.
- Emit `dist/confidence-worker.js` as a standalone file in the npm
  package that can be copied directly to static assets.
- Add CSP section to README with required directives, three hosting
  options (copy, build-tool, serve-from-route), and troubleshooting.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
csr-common now emits dist/confidence-worker.js as a first-class
build artifact. session-recording copies it instead of extracting
the worker string from source.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Codex <noreply@openai.com>
Base automatically changed from nicklasl/csr-ship-worker-js to main August 18, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant