Skip to content
Merged
Show file tree
Hide file tree
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
38 changes: 38 additions & 0 deletions src/includes/configuration/offline/javascript.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
```javascript {tabTitle: JavaScript}
import * as Sentry from "@sentry/browser";
import { Offline as OfflineIntegration } from "@sentry/integrations";

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new OfflineIntegration(
{
// limit how many events will be localled saved. Defaults to 30.
maxStoredEvents: number;
}
)],
});
```

```jsx {tabTitle: CDN}
<script
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.min.js"
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.min.js', 'sha384-base64') }}"
crossorigin="anonymous"
></script>

<script
src="https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/offline.min.js"
integrity="sha384-{{ packages.checksum('sentry.javascript.browser', 'offline.min.js', 'sha384-base64') }}"
crossorigin="anonymous"
></script>

Sentry.init({
dsn: "___PUBLIC_DSN___",
integrations: [new Offline(
{
// limit how many events will be localled saved. Defaults to 30.
maxStoredEvents: number;
}
)],
});
```
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Pluggable Integrations
description: "Learn more about pluggable integrations `ExtraErrorData`, `CaptureConsole`, `Dedupe`, `Debug`, `RewriteFrames`, `ReportingObserver`, which are snippets of code that augment functionality for specific applications and/or frameworks."
description: "Learn more about pluggable integrations ExtraErrorData, CaptureConsole, Dedupe, Debug, Offline, RewriteFrames, and ReportingObserver, which are snippets of code that augment functionality for specific applications and/or frameworks."
redirect_from:
- /platforms/javascript/integrations/plugin/
- /platforms/javascript/pluggable-integrations/
Expand All @@ -26,7 +26,6 @@ Available options:

<PlatformContent includePath="configuration/extra-error-data" />


### CaptureConsole

_Import name: `Sentry.Integrations.CaptureConsole`_
Expand All @@ -53,6 +52,16 @@ Available options:

<PlatformContent includePath="configuration/debug" />

### Offline

_Import name: `Sentry.Integrations.Offline`_

This integration uses the web browser's [online and offline events](https://developer.mozilla.org/en-US/docs/Web/API/NavigatorOnLine/Online_and_offline_events) to detect when no network connectivity is available. If offline, it saves events to the web browser's client-side storage (typically IndexedDB) then automatically uploads events when network connectivity is restored.

This plugin does not attempt to provide local storage or retries for other scenarios. For example, if the browser has a local area connection but no internet connection, then it may report that it's online, and Sentry's `Offline` plugin will not attempt to save or retry any send failures in this case.

<PlatformContent includePath="configuration/offline" />

### RewriteFrames

_Import name: `Sentry.Integrations.RewriteFrames`_
Expand Down