-
-
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 1 commit
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 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 |
|---|---|---|
|
|
@@ -4,6 +4,55 @@ sidebar_order: 30 | |
| description: "Frequently asked questions about the Dev Toolbar." | ||
| --- | ||
|
|
||
| <Expandable title="In what environments should I enable the Dev Toolbar?"> | ||
|
|
||
| Since the Dev Toolbar will be visible to users within your app, it's important to consider which environments should render it. | ||
|
|
||
| If your web application does require authentication to access: | ||
ryan953 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - In dev and staging, always initialized the Dev Toolbar. | ||
ryan953 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| - In production conditionally initialize the Dev Toolbar when an employee is logged in. | ||
|
|
||
| If you web application does not require authenticaion: | ||
| - In dev and staging environments initialize the Toolbar at all times. | ||
| - In production environments, do not initialize the Toolbar. | ||
|
|
||
| Initializing the Dev Toolbar allows all developers and testers can use it and quickly go from the page they're looking at back to Sentry for further debugging. | ||
ryan953 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 dev team is set up. | ||
|
|
||
| </Expandable> | ||
|
|
||
| <Expandable 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. | ||
|
|
||
| For example, the conditions to show show the Toolbar in dev and staging might look like this, if written in JavaScript: | ||
|
|
||
| ```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 title="Are there plans to include the Dev Toolbar in the JavaScript SDK?"> | ||
|
|
||
| The [Dev 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. | ||
|
|
@@ -14,3 +63,4 @@ Some of the differences between the two include: | |
| - 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 Dev 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> | ||
|
|
||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had suggested to name the npm package
developer toolbar(I don't have strong feels about it), but if "Dev Toolbar" is the official product name for it, we should make the npm package name match.(why can't this be "Sentry Toolbar", does it need dev at all?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
renaming the thing makes sense. the repo is called
sentry-toolbaralready.I think using
development, especially in the npm package name, was meant to make it not sound like an environment or a dev/alpha/beta tag. A proper rename avoids any confusion in that area.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Put up a rename PR: getsentry/sentry-toolbar#223
The current state is that the npm publish of
@sentry/developer-toolbar(the old name) isn't complete yet, there's a bug in the pipeline.I've asked for help with that pipeline bug, so if it's not disruptive to debugging we can land the rename name. I'll check in on that. Otherwise I might just keep working at that pipeline problem first which means we will publish the old name once. After that's working we can land the rename.