Skip to content
Open
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
2 changes: 1 addition & 1 deletion platform-includes/capture-error/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
You can pass an `Error` object to `captureException()` to get it captured as an event. It's also possible to pass non-`Error` objects and strings, but be aware that the resulting events in Sentry may be missing a stack trace.

```javascript
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

try {
aFunctionThatMightFail();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/configuration/dedupe/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
integrations: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```typescript
import * as Sentry from '@sentry/browser';
import * as Sentry from '___SDK_PACKAGE___';

Sentry.init({
dsn: '___PUBLIC_DSN___',
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/configuration/http-client/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Before using this integration, you need to install and instrument the [LaunchDarkly SDK](https://www.npmjs.com/package/launchdarkly-js-client-sdk) in your app. Learn more by reading [LaunchDarkly's docs](https://docs.launchdarkly.com/sdk/client-side/javascript).

```javascript
import * as Sentry from '@sentry/browser';
import * as Sentry from '___SDK_PACKAGE___';
import * as LaunchDarkly from 'launchdarkly-js-client-sdk';

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/configuration/offline/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
4 changes: 2 additions & 2 deletions platform-includes/configuration/openfeature/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Before using this integration, you need to install and instrument the [OpenFeature SDK](https://www.npmjs.com/package/@openfeature/web-sdk) in your app. Learn more by reading OpenFeature's [SDK docs](https://openfeature.dev/docs/reference/technologies/client/web/) and [provider docs](https://openfeature.dev/docs/reference/concepts/provider).

```javascript {tabTitle: JavaScript (Track All Evals)}
import * as Sentry from '@sentry/browser';
import * as Sentry from '___SDK_PACKAGE___';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
Expand All @@ -18,7 +18,7 @@ Sentry.captureException(new Error('Something went wrong!'));
```

```javascript {tabTitle: JavaScript (Track One Client)}
import * as Sentry from '@sentry/browser';
import * as Sentry from '___SDK_PACKAGE___';
import { OpenFeature } from '@openfeature/web-sdk';

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/configuration/statsig/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Before using this integration, you need to install and instrument Statsig in your app. Learn more by reading [Statsig's SDK reference](https://docs.statsig.com/client/javascript-sdk) and [quickstart guide](https://docs.statsig.com/guides/first-feature).

```javascript
import * as Sentry from '@sentry/browser';
import * as Sentry from '___SDK_PACKAGE___';
import { StatsigClient } from '@statsig/js-client';

const statsigClient = new StatsigClient( YOUR_SDK_KEY, { userID: 'my-user-id' }, {} ); // see Statsig SDK reference.
Expand Down
4 changes: 2 additions & 2 deletions platform-includes/configuration/unleash/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
```javascript {tabTitle: JavaScript}
import * as Sentry from '@sentry/browser';
import * as Sentry from '___SDK_PACKAGE___';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
Expand All @@ -22,7 +22,7 @@ Sentry.captureException(new Error('Something went wrong!'));
```

```javascript {tabTitle: JavaScript (deprecated)}
import * as Sentry from '@sentry/browser';
import * as Sentry from '___SDK_PACKAGE___';
import { UnleashClient } from 'unleash-proxy-client';

Sentry.init({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Then, on `pageload` you can do the following:

```javascript
import { propagationContextFromHeaders } from "@sentry/core"; // Before version 8.40.0, import from "@sentry/utils"
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

// Read meta tag values
const sentryTrace = document.querySelector("meta[name=sentry-trace]")?.content;
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/enriching-events/import/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
```javascript
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";
```
2 changes: 1 addition & 1 deletion platform-includes/getting-started-config/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Initialize Sentry as early as possible in your application's lifecycle. The setup differs slightly depending on how you installed the Sentry SDK. Be sure to follow the instructions in the related tab (npm, Loader, CDN):

```javascript {tabTitle:npm}
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
2 changes: 1 addition & 1 deletion platform-includes/metrics/usage/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ No setup required beyond SDK initialization.
<SplitSectionCode>

```javascript
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

// Count occurrences
Sentry.metrics.count("orders_created", 1);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
```javascript
// If you're using one of our framework SDK packages, like `@sentry/react`,
// substitute its name for `@sentry/browser` here
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ After configuration, you will see both `pageload` and `navigation` transactions


```javascript
// If you're using one of our framework SDK packages, like `@sentry/react`,
// substitute its name for `@sentry/browser` here
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
```javascript
// All JavaScript-based SDKs include this function, so it's safe to replace `@sentry/browser`
// with your particular SDK
import { addEventProcessor } from "@sentry/browser";
import { addEventProcessor } from "___SDK_PACKAGE___";

addEventProcessor((event) => {
if (event.type === "transaction") {
Expand All @@ -14,7 +12,7 @@ addEventProcessor((event) => {
For browser JavaScript applications using `browserTracingIntegration` integration, the `beforeStartSpan` option can be used to better group `navigation`/`pageload` transactions together based on URL.

```javascript
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
// ...
Expand Down
5 changes: 2 additions & 3 deletions platform-includes/session-replay/setup-canvas/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```javascript {14}
// import Sentry from your framework SDK (e.g. @sentry/react) instead of @sentry/browser
import * as Sentry from "@sentry/browser";
```javascript {13}
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
3 changes: 1 addition & 2 deletions platform-includes/user-feedback/setup/javascript.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
```javascript
// import Sentry from your framework SDK (e.g. @sentry/react) instead of @sentry/browser
import * as Sentry from "@sentry/browser";
import * as Sentry from "___SDK_PACKAGE___";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down