-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Update setup docs for JS SDKs #6836
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
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
20af254
feat: Minor cleanup of browser JS docs
mydea 9e2b126
style(lint): Auto commit lint changes
mydea b81a308
fix broken links
mydea 24fe4b7
rename to Yarn
mydea fe0f710
Apply suggestions from code review
mydea 4859ec3
streamline npm/yarn install scripts
mydea b828aa5
show loader as default installation for browser
mydea c75f3b7
add replay to default config
mydea c4f1c83
Apply suggestions from code review
mydea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
1 change: 0 additions & 1 deletion
1
src/platform-includes/configuration/before-breadcrumb-hint/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
src/platform-includes/configuration/before-send-fingerprint/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
```javascript | ||
Sentry.init({ | ||
// ... | ||
|
||
beforeSend(event, hint) { | ||
const error = hint.originalException; | ||
if ( | ||
|
1 change: 0 additions & 1 deletion
1
src/platform-includes/configuration/before-send-hint/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
```javascript | ||
Sentry.init({ | ||
// ... | ||
|
||
beforeSend(event, hint) { | ||
const error = hint.originalException; | ||
if ( | ||
|
1 change: 0 additions & 1 deletion
1
...platform-includes/enriching-events/breadcrumbs/before-breadcrumb/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
src/platform-includes/enriching-events/user-feedback/example-widget/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Once this is done, Sentry's JavaScript SDK captures all unhandled exceptions and transactions. | ||
Once this is done, Sentry's JavaScript SDK captures all unhandled exceptions, transactions, and Session Replays, based on the sample rates set. | ||
|
||
```javascript | ||
import * as Sentry from "@sentry/browser"; | ||
|
@@ -9,11 +9,16 @@ Sentry.init({ | |
// Alternatively, use `process.env.npm_package_version` for a dynamic release version | ||
// if your build tool supports it. | ||
release: "[email protected]", | ||
integrations: [new Sentry.BrowserTracing()], | ||
integrations: [new Sentry.BrowserTracing(), new Sentry.Replay()], | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for performance monitoring. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus for 100% of sessions with an error | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0, | ||
}); | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
To use this SDK, initialize Sentry in your Remix entry points for both the client and server. | ||
|
||
```typescript {filename: entry.client.tsx} | ||
Create two files in the root directory of your project, `entry.client.tsx` and `entry.server.tsx` (if they don't exist yet). In these files, add your initialization code for the client-side SDK and server-side SDK, respectively. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @AbhiPrasad could you sanity check this? |
||
|
||
The two configuration types are mostly the same, except that some configuration features, like Session Replay, only work in `entry.client.tsx`. | ||
|
||
```typescript {tabTitle:Client} {filename: entry.client.tsx} | ||
import { useLocation, useMatches } from "@remix-run/react"; | ||
import * as Sentry from "@sentry/remix"; | ||
import { useEffect } from "react"; | ||
|
||
Sentry.init({ | ||
dsn: "___DSN___", | ||
tracesSampleRate: 1, | ||
integrations: [ | ||
new Sentry.BrowserTracing({ | ||
routingInstrumentation: Sentry.remixRouterInstrumentation( | ||
|
@@ -16,8 +19,43 @@ Sentry.init({ | |
useMatches | ||
), | ||
}), | ||
// Replay is only available in the client | ||
new Sentry.Replay(), | ||
], | ||
// ... | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for performance monitoring. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
|
||
// Capture Replay for 10% of all sessions, | ||
// plus for 100% of sessions with an error | ||
replaysSessionSampleRate: 0.1, | ||
replaysOnErrorSampleRate: 1.0, | ||
}); | ||
``` | ||
|
||
```typescript {tabTitle:Server} {filename: entry.server.tsx} | ||
import { useLocation, useMatches } from "@remix-run/react"; | ||
import * as Sentry from "@sentry/remix"; | ||
import { useEffect } from "react"; | ||
|
||
Sentry.init({ | ||
dsn: "___DSN___", | ||
integrations: [ | ||
new Sentry.BrowserTracing({ | ||
routingInstrumentation: Sentry.remixRouterInstrumentation( | ||
useEffect, | ||
useLocation, | ||
useMatches | ||
), | ||
}), | ||
], | ||
|
||
// Set tracesSampleRate to 1.0 to capture 100% | ||
// of transactions for performance monitoring. | ||
// We recommend adjusting this value in production | ||
tracesSampleRate: 1.0, | ||
}); | ||
``` | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 5 additions & 5 deletions
10
src/platform-includes/getting-started-install/javascript.electron.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
```bash | ||
# Using yarn | ||
yarn add @sentry/electron | ||
```bash {tabTitle:npm} | ||
npm install --save @sentry/electron | ||
``` | ||
|
||
# Using npm | ||
npm install @sentry/electron | ||
```bash {tabTitle:Yarn} | ||
yarn add @sentry/electron | ||
``` |
21 changes: 17 additions & 4 deletions
21
src/platform-includes/getting-started-install/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
src/platform-includes/getting-started-install/javascript.react.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
```bash | ||
# Using npm | ||
```bash {tabTitle:npm} | ||
npm install --save @sentry/react | ||
``` | ||
|
||
# Using yarn | ||
```bash {tabTitle:Yarn} | ||
yarn add @sentry/react | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
npm install --save @sentry/remix | ||
``` | ||
|
||
```bash {tabTitle:yarn} | ||
```bash {tabTitle:Yarn} | ||
yarn add @sentry/remix | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
npm install --save @sentry/svelte | ||
``` | ||
|
||
```bash {tabTitle:yarn} | ||
```bash {tabTitle:Yarn} | ||
yarn add @sentry/svelte | ||
``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
```bash | ||
# Using yarn | ||
yarn add @sentry/node | ||
# Using npm | ||
```bash {tabTitle:npm} | ||
npm install --save @sentry/node | ||
``` | ||
|
||
```bash {tabTitle:Yarn} | ||
yarn add @sentry/node | ||
``` |
11 changes: 6 additions & 5 deletions
11
src/platform-includes/performance/configure-sample-rate/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/platform-includes/performance/enable-tracing/javascript.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.