Skip to content

Conversation

timfish
Copy link
Collaborator

@timfish timfish commented Sep 10, 2025

You can set the IPC namespace in the main process:

import * as Sentry from '@sentry/electron/main';

Sentry.init({
  dsn: '__DSN__',
  ipcNamespace: 'some-app',
});

And the renderers:

import * as Sentry from '@sentry/electron/renderer';

Sentry.init({
  ipcNamespace: 'some-app',
});

And for the preload:

import { hookupIpc } from '@sentry/electron/preload-namespaced';

hookupIpc('some-app');

@timfish timfish changed the title feat: Allow namespaced IPC feat: Namespaced IPC Sep 11, 2025
@timfish timfish marked this pull request as ready for review September 11, 2025 16:32
@timfish timfish requested a review from AbhiPrasad September 11, 2025 16:32
@timfish timfish enabled auto-merge (squash) September 12, 2025 12:27
@timfish timfish disabled auto-merge September 12, 2025 12:57
@timfish timfish requested a review from AbhiPrasad September 15, 2025 19:27
@timfish timfish merged commit 78ed255 into getsentry:master Sep 17, 2025
140 of 157 checks passed
AbhiPrasad added a commit to getsentry/sentry-docs that referenced this pull request Sep 18, 2025
Documents getsentry/sentry-electron#1234

## DESCRIBE YOUR PR
This PR documents the `ipcNamespace` option for the Sentry Electron SDK.
This option allows users to specify a custom namespace for Sentry's IPC
channels, preventing potential conflicts in applications that use
multiple IPC channels.

The documentation has been added to:
* The main Electron guide
(`docs/platforms/javascript/guides/electron/index.mdx`) with a new
"Custom IPC Namespace" subsection.
* The common configuration options page
(`docs/platforms/javascript/common/configuration/options.mdx`) with a
detailed `SdkOption` entry.

## IS YOUR CHANGE URGENT?  
- [ ] Urgent deadline (GA date, etc.): <!-- ENTER DATE HERE -->
- [ ] Other deadline: <!-- ENTER DATE HERE -->
- [x] None: Not urgent, can wait up to 1 week+

## SLA

- Teamwork makes the dream work, so please add a reviewer to your PRs.
- Please give the docs team up to 1 week to review your PR unless you've
added an urgent due date to it.
Thanks in advance for your help!

## PRE-MERGE CHECKLIST

*Make sure you've checked the following before merging your changes:*

- [ ] Checked Vercel preview for correctness, including links
- [ ] PR was reviewed and approved by any necessary SMEs (subject matter
experts)
- [ ] PR was reviewed and approved by a member of the [Sentry docs
team](https://github.com/orgs/getsentry/teams/docs)

## LEGAL BOILERPLATE

<!-- Sentry employees and contractors can delete or ignore this section.
-->

Look, I get it. The entity doing business as "Sentry" was incorporated
in the State of Delaware in 2015 as Functional Software, Inc. and is
gonna need some rights from me in order to utilize my contributions in
this here PR. So here's the deal: I retain all rights, title and
interest in and to my contributions, and by keeping this boilerplate
intact I confirm that Sentry can use, modify, copy, and redistribute my
contributions, under Sentry's choice of terms.

## EXTRA RESOURCES

- [Sentry Docs contributor guide](https://docs.sentry.io/contributing/)

---
[Slack
Thread](https://sentry.slack.com/archives/D0913PZP35W/p1758212038049479?thread_ts=1758212038.049479&cid=D0913PZP35W)

<a
href="https://cursor.com/background-agent?bcId=bc-1e45b0f6-7e47-45dd-80df-7c8f432ef00a"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-cursor-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-cursor-light.svg"><img alt="Open in
Cursor"
src="https://cursor.com/open-in-cursor.svg"></picture></a>&nbsp;<a
href="https://cursor.com/agents?id=bc-1e45b0f6-7e47-45dd-80df-7c8f432ef00a"><picture><source
media="(prefers-color-scheme: dark)"
srcset="https://cursor.com/open-in-web-dark.svg"><source
media="(prefers-color-scheme: light)"
srcset="https://cursor.com/open-in-web-light.svg"><img alt="Open in Web"
src="https://cursor.com/open-in-web.svg"></picture></a>

---------

Co-authored-by: Cursor Agent <[email protected]>
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.

Namespace Sentry Electron IPC
2 participants