You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/product/dev-toolbar/index.mdx
+11-11Lines changed: 11 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,44 +9,44 @@ description: "Bring critical Sentry insights and tools directly into your web ap
9
9
[GitHub](https://github.com/getsentry/sentry-toolbar/issues) if you have any feedback or concerns.
10
10
</Alert>
11
11
12
-
Developers spend a lot of time troubleshooting their web apps on local, staging, and production environments. The Sentry Dev Toolbar pulls data from [sentry.io](http://sentry.io) and surfaces relevant actionable issues to you when you have the most context for understanding it: as you browse your own site. The Dev Toolbar is a floating widget in your web app, offering meaningful Sentry insights for the specific page being viewed through three different **page-aware** panels: Issues, Feedback, and Feature Flags.
12
+
Developers spend a lot of time troubleshooting their web apps on local, staging, and production environments. The Sentry Dev Toolbar pulls data from [sentry.io](http://sentry.io) and surfaces relevant, actionable issues to you when you have the most context for understanding it: as you browse your own site. The Dev Toolbar is a floating widget in your web app, offering meaningful Sentry insights for the specific page being viewed through three different **page-aware** panels: Issues, Feedback, and Feature Flags.
13
13
14
14

15
15
16
16
## Issues Panel
17
17
18
-
The issues panel shows you your highest priority frontend [issues](https://docs.sentry.io/product/issues/) for the page you are currently viewing. From the Dev Toolbar, you can quickly jump into specific issues in Sentry to get more detailed information and take action (for example, assign to a team member or mark as resolved). With the issues panel, you can browse the pages that are most important to your business and understand the top issues impacting your user base.
18
+
The issues panel shows you your highest priority frontend [issues](https://docs.sentry.io/product/issues/) for the page you are currently viewing. From the Dev Toolbar, you can quickly jump into specific issues in Sentry to get more detailed information (e.g. Sentry project, issue title, and description, and when the issue was first and last seen) and take action (e.g. assign to a team member or mark as resolved). With the issues panel, you can browse the pages that are most important to your business and understand the top issues impacting your user base.
19
19
20
20

21
21
22
22
## Feedback Panel
23
23
24
-
The feedback panel shows you the most recent user feedback messages for the page you are on, so you can more easily contextualize user feedback. The feedback can include misleading UX, broken links, typos, and so on, covering more bugs and suboptimal experiences than code-thrown errors. The feedback panel works by pulling feedback messages from [Sentry’s User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget).
24
+
The feedback panel shows you the most recent user feedback messages for the page you are on, so you can more easily contextualize user feedback. The feedback often describes suboptimal experiences that are not strictly code-thrown errors, such as misleading UX, broken links, and typos. The feedback panel works by pulling feedback messages from [Sentry’s User Feedback Widget](https://docs.sentry.io/product/user-feedback/#user-feedback-widget). Just like with the Issues panel, clicking on a particular user feedback will take you to the full detailed User Feedback page within Sentry.
25
25
26
26

27
27
28
28
## Feature Flags Panel
29
29
30
-
Feature flags are a powerful tool that allow you to control the visibility of features in your app, enabling you to ship, test, and experiment with confidence. The feature flag panel allows you to quickly view and override feature flags locally that your team has enabled for your web application. You can override any feature flag to be `true` or `false` for your browser session, so you can verify its behavior and observe the impact it might have on errors. Learn more about how to [configure the feature flag panel](/product/dev-toolbar/setup/#implement-feature-flag-adapter).
30
+
Feature flags are a powerful tool that allow you to control the visibility of features in your app, enabling you to ship, test, and experiment with confidence. The feature flag panel allows you to quickly view and override feature flags locally. You can override any feature flag to be `true` or `false` for your browser session, so you can verify its behavior and observe the impact it might have on errors. Learn more about how to [configure the feature flag panel](/product/dev-toolbar/setup/#implement-feature-flag-adapter).
31
31
32
-
[Learn more](/product/explore/feature-flags/) about what data Sentry can track related to your feature flagging system.
32
+
<Note>
33
+
[Learn more](/product/explore/feature-flags/) about what data Sentry can track related to your feature flagging system.
34
+
</Note>
33
35
34
36

35
37
36
38
## Login Flow
37
39
38
-
After setting up the Dev Toolbar you’ll see a “Login to Sentry” button floating in the center of the page. Your team will need to click this button and login to Sentry before they can access any information from your Sentry organization.
40
+
After setting up the Dev Toolbar you’ll see a “Login to Sentry” button floating in the center of the page. To access any information from your Sentry organization you have to click this button and login to sentry.
You'll need to add your domain URL to Allowed Origins on Sentry's Dev Toolbar settings page.
49
+
You'll need to add your domain URL to Allowed Origins in Sentry on the Settings > Project > Dev Toolbar page.
48
50

49
51
50
-
Learn more about [deploying the toolbar to different environments](/product/dev-toolbar/setup/#deploying-to-production--dev-environments), and [conditionally inserting the toolbar script tag](/product/dev-toolbar/setup/#conditionally-inserting-script-tag).
51
-
52
-
### [Set Up](/product/dev-toolbar/setup)
52
+
Learn more about setting up the toolbar, including configuring a feature flag provider and integrating the toolbar in different environments, on the next page.
Copy file name to clipboardExpand all lines: docs/product/dev-toolbar/setup.mdx
+38-34Lines changed: 38 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,14 +16,18 @@ description: "Get started with Sentry's Dev Toolbar, bringing critical Sentry in
16
16
</Alert>
17
17
18
18
You need to complete two steps to get the toolbar rendered on the page:
19
-
1. Add or dynamically inject `<script defer src="https://browser.sentry-cdn.com/sentry-toolbar/latest/toolbar.min.js"></script>` into your web app. This script uses the `defer` attribute so that it does not block document parsing. The script tag can be inserted at the bottom of the page so it doesn’t block other critical Javascript.
19
+
1. Add or dynamically inject the following script into your web app:
@@ -35,7 +39,7 @@ You need to complete two steps to get the toolbar rendered on the page:
35
39
36
40
If you have called `SentryToolbar.init({...})` to render the toolbar, but now want to manually remove or unmount it from the page, you can call the cleanup function that is returned from `init()`. This will unmount all the injected HTML and CSS. Login credentials will not be removed, so you can re-insert the toolbar and still be authenticated.
@@ -44,13 +48,39 @@ If you have called `SentryToolbar.init({...})` to render the toolbar, but now wa
44
48
</script>
45
49
```
46
50
51
+
## Init Configuration Fields
52
+
53
+
The following fields can be passed into the `.init()` function.
54
+
55
+
At minimum, you should be calling `.init()` with these three fields:
56
+
```javascript
57
+
window.SentryToolbar.init({
58
+
organizationSlug:'acme',
59
+
projectIdOrSlug:'website',
60
+
environment:'production'
61
+
});
62
+
```
63
+
64
+
| Field Name | Type | Description | Default Value |
65
+
| ----- | ----- | ----- | ----- |
66
+
|`organizationSlug`|`string`| The organization that users should login to. For example \'acme\'|*Required Value*|
67
+
|`projectIdOrSlug`|`string \| number`| The project for which this website/webapp is associated. |*Required Value*|
68
+
|`environment (optional)`|`string \| string[] \| undefined`| The environment of this deployment. Used to narrow search results in the Toolbar UI. Set to `undefined` or `""` or `\[\]` if you want to see results from all environments. |`undefined`|
69
+
|`placement (optional)`|`'right-edge' \| 'bottom-right-corner'`| Where to render the toolbar on the screen. |`'right-edge'`|
70
+
|`theme (optional)`|`'system' \| 'dark' \| 'light'`| Whether to use dark or light mode. |`'system'`|
71
+
|`featureFlags (optional)`|`FeatureFlagAdapter \| undefined`| See [Implement FeatureFlagAdapter](/product/dev-toolbar/setup//#implement-feature-flag-adapter) below |`undefined`|
72
+
|`sentryOrigin (optional)`|`string \| undefined`| The origin where Sentry can be found. Used for loading the connection to Sentry, and generating links to the website. For example: `'https://acme.sentry.io'`|`'https://sentry.io'`|
73
+
|`domId (optional)`|`string \| undefined`| The `id` given to the \<div\> that is created to contain the toolbar html. |`'sentry-toolbar'`|
74
+
|`debug (optional)`|`string \| undefined`| A comma separated string of debug targets to enable. Example: `'logging,state'`. If the list contains 'all' or 'true' then all targets will be enabled. Valid targets: `'logging' 'login-success' 'settings' 'state'`|`undefined`|
75
+
|`mountPoint (optional)`|`HTMLElement \| () => HTMLElement \| undefined`| Where to mount the toolbar in the DOM. |`document.body`|
76
+
47
77
## Implement Feature Flag Adapter
48
78
49
-
In order to integrate your Feature Flagging platform with the Dev Toolbar, you will need an Adapter that can read flag data from your provider, and also store and retrieve a list of overrides to apply to your local browser session.
79
+
In order to integrate your Feature Flagging platform with the Dev Toolbar, you will need an adapter that can read flag data from your provider, and also store and retrieve a list of overrides to apply to your local browser session.
50
80
51
81
We plan to create adapters for OpenFeature and LaunchDarkly soon!
52
82
53
-
The interface you need to implement for an Adapter is:
83
+
The adapter interface is:
54
84
```javascript
55
85
type FlagValue = boolean | string | number |undefined;
[MockFeatureFlagIntegration.tsx](https://github.com/getsentry/sentry-toolbar/blob/301c31d561a81e3fd8ffc9532aad3a60af685916/src/env/demo/MockFeatureFlagIntegration.tsx) is an example adapter to use as a reference.
87
117
88
-
## Init Configuration Fields
89
-
90
-
The following fields can be passed into the `.init()` function.
91
-
92
-
For example, a minimal configuration looks like:
93
-
```javascript
94
-
window.SentryToolbar.init({
95
-
organizationSlug: ‘acme’,
96
-
projectIdOrSlug: ‘website’,
97
-
environment: ‘production’
98
-
});
99
-
```
100
-
101
-
| Field Name | Type | Description | Default Value |
102
-
| ----- | ----- | ----- | ----- |
103
-
|`organizationSlug`|`string`| The organization that users should login to. For example \'acme\'|*Required Value*|
104
-
|`projectIdOrSlug`|`string \| number`| The project for which this website/webapp is associated. |*Required Value*|
105
-
|`environment (optional)`|`string \| string[] \| undefined`| The environment of this deployment. Used to narrow search results in the Toolbar UI. Set to `undefined` or `""` or `\[\]` if you want to see results from all environments. |`undefined`|
106
-
|`placement (optional)`|`'right-edge' \| 'bottom-right-corner'`| Where to render the toolbar on the screen. |`'right-edge'`|
107
-
|`theme (optional)`|`'system' \| 'dark' \| 'light'`| Whether to use dark or light mode. |`'system'`|
108
-
|`featureFlags (optional)`|`FeatureFlagAdapter \| undefined`| See [Implement FeatureFlagAdapter](/product/dev-toolbar/setup//#implement-feature-flag-adapter) above |`undefined`|
109
-
|`sentryOrigin (optional)`|`string \| undefined`| The origin where Sentry can be found. Used for loading the connection to Sentry, and generating links to the website. For example: `'[https://acme.sentry.io]'`|`'https://sentry.io'`|
110
-
|`domId (optional)`|`string \| undefined`| The `id` given to the \<div\> that is created to contain the toolbar html. |`'sentry-toolbar'`|
111
-
|`debug (optional)`|`string \| undefined`| A comma separated string of debug targets to enable. Example: `'logging,state'`. If the list contains 'all' or 'true' then all targets will be enabled. Valid targets: `'logging' 'login-success' 'settings' 'state'`|`undefined`|
112
-
|`mountPoint (optional)`|`HTMLElement \| () => HTMLElement \| undefined`| Where to mount the toolbar in the DOM. |`document.body`|
113
-
114
118
115
-
## Deploying To Production & Dev Environments
119
+
## Deploying To Dev, Staging, and Production Environments
116
120
Since the Dev Toolbar is deployed onto specific pages, it's strongly recommended that you consider which environments the toolbar should apply to.
117
121
118
122
In dev and staging environments, you might want to *unconditionally* include the toolbar so that all developers and testers can use it and quickly go from the page they're looking at back to Sentry for further debugging.
@@ -140,5 +144,5 @@ If the toolbar `<script>` is accidentally included on your site, and `SentryTool
140
144
141
145
## Conditionally Inserting Script Tag
142
146
143
-
It's possible to dynamically insert the script tag inside a single-page app, prior to calling `SentryToolbar.init()`, so that it’s only visible to authorized users. See [`docs/conditional-script.md`](http://conditional-script.md) for example code. This will help reduce network traffic for your users because they do not have the credentials needed to login.
147
+
It's possible to dynamically insert the script tag inside a single-page app, prior to calling `SentryToolbar.init()`, so that it’s only visible to authorized users. See [`docs/conditional-script.md`](https://github.com/getsentry/sentry-toolbar/blob/main/docs/conditional-script.md) for example code. This will help reduce network traffic for your users because they do not have the credentials needed to login.
144
148
This example code will be eventually implemented as an NPM package, but for now it can be done manually.
0 commit comments