Skip to content

Document default Electron offline support #5758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/platforms/javascript/guides/electron/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,33 @@ init({ /* config */ }, reactInit);

```

## Offline Support

The default transport automatically handles offline events caching. Following, are a
number of options that allow you to customize queueing behavior:

```javascript
import * as Sentry from "@sentry/electron/main";

Sentry.init({
dsn: "___PUBLIC_DSN___",
transportOptions: {
// The maximum number of days to keep an event in the queue.
maxQueueAgeDays: 30,
// The maximum number of events to keep in the queue.
maxQueueCount: 30,
// Called every time the number of requests in the queue changes.
queuedLengthChanged: (length) => { },
// Called before attempting to send an event to Sentry. Used to override queuing behavior.
//
// Return 'send' to attempt to send the event.
// Return 'queue' to queue and persist the event for sending later.
// Return 'drop' to drop the event.
beforeSend: (request) => isOnline() ? 'send' : 'queue'
}
});
```

## Inter-Process Communication

To give detailed information for all events including native crashes, the SDK merges context, scope and breadcrumbs from all processes in the Electron `main` process.
Expand Down