Skip to content

docs: rewrite the Electron integration around @bugsplat/electron - #334

Open
bobbyg603 wants to merge 3 commits into
masterfrom
docs/electron-sdk
Open

docs: rewrite the Electron integration around @bugsplat/electron#334
bobbyg603 wants to merge 3 commits into
masterfrom
docs/electron-sdk

Conversation

@bobbyg603

Copy link
Copy Markdown
Member

Summary

Rewrites the Electron integration page (introduction/getting-started/integrations/desktop/electron.md, same path) around the new @bugsplat/electron package: one init() in the main process replaces the separate crashReporter.start() + bugsplat-node (+ bugsplat in each renderer) setup.

  • Installation, main and renderer quick start, options overview, how each failure type is captured (native crashes, JS errors, renderer hangs with JS call stacks, OOM crash keys, process-gone signals)
  • Renderer setup: sandbox/context isolation, no CSP connect-src needed, Document-Policy recipe for hang call stacks, React/Angular note
  • Symbols/source maps with -i/-s client credentials instead of the deprecated -u/-p username/password flags
  • An "Upgrading from crashReporter and bugsplat-node" section for existing users
  • Existing screenshots are kept

Merge once @bugsplat/electron is published to npm (tracked in BugSplat-Git/bugsplat-electron).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KoWGNtyTyAq184QWQ2aquX

Copilot AI lite review requested due to automatic review settings August 26, 2026 23:22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the Electron integration documentation to center on the new @bugsplat/electron package, describing a single init()-based setup and documenting how it captures native crashes, JS errors, hangs, OOM events, and process-gone signals.

Changes:

  • Replaces the legacy crashReporter.start + bugsplat-node + per-renderer setup with a main-process init() quick start and a renderer init() snippet.
  • Adds an options overview, “how it works” capture matrix, and renderer setup notes (CSP, sandbox/context isolation, Document-Policy for hang stacks).
  • Updates symbols/source maps guidance to use client credentials and adds an upgrade section for existing integrations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +49 to +50
bugsplat.setUser('fred@bedrock.com');
bugsplat.setAttribute('plan', 'pro');
* **One identity everywhere**: the user, email, application key, description and attributes you set in main or in a renderer are applied to native crash keys in every process and to every JavaScript report.

BugSplat-node can also be used to collect [uncaughtException](https://nodejs.org/api/process.html#process\_event\_uncaughtexception) and [unhandledRejection](https://nodejs.org/api/process.html#process\_event\_unhandledrejection) events in your application's JavaScript code.
`@bugsplat/electron` supports Electron 35 and later. It replaces the previous two-step integration of `electron.crashReporter` plus [bugsplat-node](../cross-platform/node.js.md); see [Upgrading](#upgrading-from-crashreporter-and-bugsplat-node) below if you use that today.
| JavaScript error in main | `uncaughtException` / `unhandledRejection` | JavaScript report |
| JavaScript error in a renderer | `window` `error` / `unhandledrejection` → preload bridge → IPC → main | JavaScript report with the renderer call stack, URL and title |
| Renderer hang | `unresponsive` + `WebFrameMain.collectJavaScriptCallStack()` | `RendererUnresponsive` report grouped by the hung JS frame |
| Renderer out of memory | Electron ≥ 42 writes `electron.v8-oom.*` crash keys | Minidump with `electron.v8-oom.stack` and heap statistics |
```

You may see the following error in the console:
* If your renderer is built with React or Angular, keep using [@bugsplat/react](../web/react.md) or [bugsplat-ng](../web/angular.md) for component-tree errors. The renderer client is a `BugSplat` instance, so `@bugsplat/react`'s `ErrorBoundary` can reuse it via `scope={{ getClient }}`.
…ctron-crasher

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KoWGNtyTyAq184QWQ2aquX
Copilot AI review requested due to automatic review settings August 26, 2026 23:33

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (4)

Previously missed (3) — in code that hasn't changed since the last review.

introduction/getting-started/integrations/desktop/electron.md:74

  • The no-bundler renderer instructions are inconsistent: the script tag loads ./vendor/renderer.global.js, but the next sentence says to copy the file “next to your page”. As written, a reader may copy it to the wrong location and get a 404.
Copy `node_modules/@bugsplat/electron/dist/renderer.global.js` next to your page at build time.

introduction/getting-started/integrations/desktop/electron.md:159

  • This withJsCallStackPolicy example uses protocol, net, and pathToFileURL without importing them, and fileFor(...) is undefined. As-is, it's not copy/paste runnable and may confuse readers; making the imports explicit and clarifying the URL→file mapping helps.
import { withJsCallStackPolicy } from '@bugsplat/electron';

protocol.handle('app', async (request) => {
    const response = await net.fetch(pathToFileURL(fileFor(request.url)).toString());
    return new Response(response.body, {

introduction/getting-started/integrations/desktop/electron.md:93

  • The Options snippet calls init({ ... }) without importing init, and it appears immediately after a renderer-only init() example. Adding the import inside the code block makes the snippet self-contained and clarifies that this is the main-process initializer.
init({
    database: 'fred',
    application: 'my-electron-app',      // defaults to app.name

introduction/getting-started/integrations/desktop/electron.md:17

  • The link to the Node.js integration points to ../cross-platform/node.js.md, but there is no integrations/cross-platform directory in this repo. This will render as a broken link; it likely should target the existing Node.js page under integrations/web/node.js.md.
`@bugsplat/electron` supports Electron 35 and later. It replaces the previous two-step integration of `electron.crashReporter` plus [bugsplat-node](../cross-platform/node.js.md); see [Upgrading](#upgrading-from-crashreporter-and-bugsplat-node) below if you use that today.

Copilot AI review requested due to automatic review settings August 26, 2026 23:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (3)

Previously missed (1) — in code that hasn't changed since the last review.

introduction/getting-started/integrations/desktop/electron.md:47

  • The main-process quick start mixes ESM (import) with CommonJS (require('./package.json')) and assumes the main script sits next to package.json. That’s not true for many Electron/TS setups (e.g. src/main.ts), so copying this snippet can fail. Since application/version already default to app.name/app.getVersion(), the example can avoid package.json entirely and stay consistent ESM.

This issue also appears on line 155 of the same file.

import { init } from '@bugsplat/electron';

const { database, name, version } = require('./package.json');

const bugsplat = init({ database, application: name, version });

introduction/getting-started/integrations/desktop/electron.md:17

  • This internal link points to ../cross-platform/node.js.md, but there is no integrations/cross-platform directory in this repo (the Node.js integration doc lives under integrations/web/node.js.md). As written, the link will 404 in the published docs.
`@bugsplat/electron` supports Electron 35 and later. It replaces the previous two-step integration of `electron.crashReporter` plus [bugsplat-node](../cross-platform/node.js.md); see [Upgrading](#upgrading-from-crashreporter-and-bugsplat-node) below if you use that today.

introduction/getting-started/integrations/desktop/electron.md:155

  • This snippet calls fileFor(request.url), but fileFor isn’t defined anywhere in the doc (and doesn’t appear elsewhere in the repo), so readers can’t run this as-is.
    const response = await net.fetch(pathToFileURL(fileFor(request.url)).toString());

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.

2 participants