-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat(toolbar): Add setup instructions for the Sentry Toolbar using the react hook useSentryToolbar #12845
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
feat(toolbar): Add setup instructions for the Sentry Toolbar using the react hook useSentryToolbar #12845
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
3402def
feat(toolbar): Add setup instructions for the Dev Toolbar using the r…
ryan953 a2c6120
deeplink directly to the FAQ entries
ryan953 e4f17b9
rename to Sentry Toolbar
ryan953 928a05a
grammar fixes from code review
ryan953 a7a40a9
add redirects for page path changes
ryan953 39ac446
more grammar
ryan953 2a136c7
Apply suggestions from code review
ryan953 d972bef
more renames
ryan953 41013fb
create a sub-heading for react-hook options
ryan953 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
This file was deleted.
Oops, something went wrong.
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 |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| --- | ||
| title: FAQ | ||
| sidebar_order: 30 | ||
| description: "Frequently asked questions about the Sentry Toolbar." | ||
| --- | ||
|
|
||
| <Expandable permalink title="In what environments should I enable the Toolbar?"> | ||
|
|
||
| Since the Sentry Toolbar will be visible to users within your app, it's important to consider which environments should render it. | ||
|
|
||
| If your web application requires authentication to access: | ||
| - In development and staging, always initialized the Sentry Toolbar. | ||
| - In production conditionally initialize the Sentry Toolbar when an employee is logged in. | ||
ryan953 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| If you web application does not require authenticaion: | ||
| - In development and staging environments initialize the Toolbar at all times. | ||
ryan953 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - In production environments, do not initialize the Toolbar. | ||
|
|
||
| Initializing the Sentry Toolbar allows all developers and testers to quickly go from the page they're looking at, back to Sentry for further debugging. | ||
| In production it can make it easier for developers to reproduce issues, but it should not be initialized for all users of the site -- only when an employee/engineer/etc visits. | ||
|
|
||
| Once you decide where and when you want the Toolbar to appear, you'll write those conditions into your codebase. The specific implementation is something you'll need to write based on how your app works and how your team is set up. | ||
|
|
||
| </Expandable> | ||
|
|
||
| <Expandable permalink title="How can I conditionally initialize the Toolbar?"> | ||
|
|
||
| Implementing the specific conditions for initializing the Toolbar will vary from app to app and which ever framework or template library is in use. | ||
ryan953 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| For example, the conditions to show show the Toolbar in development and staging might look like this, if written in JavaScript: | ||
ryan953 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ```html {tabTitle:CDN} | ||
| <script> | ||
| const env = process.env.ENVIRONMENT || 'development'; | ||
| const isDev = env === 'development' || env === 'staging'; | ||
| if (isDev) { | ||
| window.SentryToolbar.init({ ... }); | ||
| } | ||
| </script> | ||
| ``` | ||
| ```javascript {tabTitle:React} | ||
| const env = process.env.ENVIRONMENT || 'development'; | ||
| const isDev = env === 'development' || env === 'staging'; | ||
|
|
||
| useSentryToolbar({ | ||
| enabled: isDev, | ||
| initProps: { | ||
| ... | ||
| }, | ||
| }) | ||
| ``` | ||
|
|
||
| </Expandable> | ||
|
|
||
| <Expandable permalink title="Are there plans to include the Toolbar in the JavaScript SDK?"> | ||
|
|
||
| The [Sentry Toolbar](https://github.com/getsentry/sentry-toolbar) and the [JavaScript SDK](https://github.com/getsentry/sentry-javascript) are distinct features that we intentionally keep separated. | ||
|
|
||
| Some of the differences between the two include: | ||
| - The Toolbar is a UI product focused on making it easier to find and take action on existing data, while the SDK functions as infrastructure to collect and send data to the server. | ||
| - The Toolbar has a different set of [dependencies](https://github.com/getsentry/sentry-toolbar/blob/main/package.json) and uses different browser APIs that the JavaScript SDK does not use. For example: the Toolbar will interact with things like cookies and local storage. By keeping these pieces of code separate, it's easier to audit the [SDK code on GitHub](https://github.com/getsentry/sentry-javascript) to verify that it is not persisting information inside end-users' browsers. | ||
| - The setup and deploy instruction are very different. The SDK is best deployed on staging and production environments, and can be configured easily with environment variables. The Sentry Toolbar requires special considerations to deploy it into production, usually by creating a condition so that it's only included for members of your own Sentry organization. | ||
|
|
||
| </Expandable> | ||
|
|
||
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
147 changes: 86 additions & 61 deletions
147
docs/product/dev-toolbar/setup.mdx → docs/product/sentry-toolbar/setup.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
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.