diff --git a/docs/product/dev-toolbar/faq.mdx b/docs/product/dev-toolbar/faq.mdx deleted file mode 100644 index 366709c78de19..0000000000000 --- a/docs/product/dev-toolbar/faq.mdx +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: FAQ -sidebar_order: 30 -description: "Frequently asked questions about the Dev Toolbar." ---- - - - -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. - -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 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. - - diff --git a/docs/product/dev-toolbar/index.mdx b/docs/product/dev-toolbar/index.mdx deleted file mode 100644 index 6827badf8b001..0000000000000 --- a/docs/product/dev-toolbar/index.mdx +++ /dev/null @@ -1,46 +0,0 @@ ---- -title: Dev Toolbar -sidebar_order: 120 -description: "Bring critical Sentry insights and tools directly into your web app for easier troubleshooting with the Dev Toolbar." ---- - - - The Dev Toolbar is currently in **beta**. Beta features are still in progress and may have bugs. Please reach out on - [GitHub](https://github.com/getsentry/sentry-toolbar/issues) if you have any feedback or concerns. - - -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. - -![Collapsed Dev Toolbar in context of a website](./img/toolbar-collapsed.png) - -## Issues Panel - -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 (examples: Sentry project, issue title, description, and when the issue was first and last seen) and take action (examples: 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. - -![Dev Toolbar with the Issues Panel open](./img/issues-panel.png) - -## Feedback Panel - -The feedback panel shows you the most recent user feedback messages for the page you are on, so you can more easily contextualize it. 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. - -![Dev Toolbar with the Feedback Panel open](./img/feedback-panel.png) - -## Feature Flags Panel - -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) and [what data Sentry can track](/product/explore/feature-flags/) related to your feature flagging system. - - -![Dev Toolbar with the Feature Flags Panel open](./img/feature-flags-panel.png) - -## Login Flow - -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. -![Dev Toolbar login button](./img/login-button.png) - -After clicking the button, you will see a pop-up window for logging in to Sentry. -![Sentry log in pop up](./img/login-popup.png) - -If it's your first time [setting up the Dev Toolbar](/product/dev-toolbar/setup) , there will be a button with a link to Sentry's Dev Toolbar settings page to configure your domain. -![Dev Toolbar configure domains button](./img/configure-domain.png) - -Learn more about setting up the toolbar, including configuring a feature flag provider and integrating the toolbar in different environments, on the next page. diff --git a/docs/product/sentry-toolbar/faq.mdx b/docs/product/sentry-toolbar/faq.mdx new file mode 100644 index 0000000000000..0051584fac417 --- /dev/null +++ b/docs/product/sentry-toolbar/faq.mdx @@ -0,0 +1,66 @@ +--- +title: FAQ +sidebar_order: 30 +description: "Frequently asked questions about the Sentry 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 initialize the Sentry Toolbar. +- In production, conditionally initialize the Sentry Toolbar when an employee is logged in. + +If you web application does not require authenticaion: +- In development and staging environments, initialize the Toolbar at all times. +- 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. + + + + + +Implementing the specific conditions for initializing the Toolbar will vary from app to app and whichever framework or template library is in use. + +For example, the conditions to show the Toolbar in development and staging might look like this, if written in JavaScript: + +```html {tabTitle:CDN} + +``` +```javascript {tabTitle:React} +const env = process.env.ENVIRONMENT || 'development'; +const isDev = env === 'development' || env === 'staging'; + +useSentryToolbar({ + enabled: isDev, + initProps: { + ... + }, +}) +``` + + + + + +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. + + + diff --git a/docs/product/dev-toolbar/img/configure-domain.png b/docs/product/sentry-toolbar/img/configure-domain.png similarity index 100% rename from docs/product/dev-toolbar/img/configure-domain.png rename to docs/product/sentry-toolbar/img/configure-domain.png diff --git a/docs/product/dev-toolbar/img/feature-flags-panel.png b/docs/product/sentry-toolbar/img/feature-flags-panel.png similarity index 100% rename from docs/product/dev-toolbar/img/feature-flags-panel.png rename to docs/product/sentry-toolbar/img/feature-flags-panel.png diff --git a/docs/product/dev-toolbar/img/feedback-panel.png b/docs/product/sentry-toolbar/img/feedback-panel.png similarity index 100% rename from docs/product/dev-toolbar/img/feedback-panel.png rename to docs/product/sentry-toolbar/img/feedback-panel.png diff --git a/docs/product/dev-toolbar/img/issues-panel.png b/docs/product/sentry-toolbar/img/issues-panel.png similarity index 100% rename from docs/product/dev-toolbar/img/issues-panel.png rename to docs/product/sentry-toolbar/img/issues-panel.png diff --git a/docs/product/dev-toolbar/img/login-button.png b/docs/product/sentry-toolbar/img/login-button.png similarity index 100% rename from docs/product/dev-toolbar/img/login-button.png rename to docs/product/sentry-toolbar/img/login-button.png diff --git a/docs/product/dev-toolbar/img/login-popup.png b/docs/product/sentry-toolbar/img/login-popup.png similarity index 100% rename from docs/product/dev-toolbar/img/login-popup.png rename to docs/product/sentry-toolbar/img/login-popup.png diff --git a/docs/product/dev-toolbar/img/sentry-project-settings-toolbar.png b/docs/product/sentry-toolbar/img/sentry-project-settings-toolbar.png similarity index 100% rename from docs/product/dev-toolbar/img/sentry-project-settings-toolbar.png rename to docs/product/sentry-toolbar/img/sentry-project-settings-toolbar.png diff --git a/docs/product/dev-toolbar/img/toolbar-collapsed.png b/docs/product/sentry-toolbar/img/toolbar-collapsed.png similarity index 100% rename from docs/product/dev-toolbar/img/toolbar-collapsed.png rename to docs/product/sentry-toolbar/img/toolbar-collapsed.png diff --git a/docs/product/sentry-toolbar/index.mdx b/docs/product/sentry-toolbar/index.mdx new file mode 100644 index 0000000000000..20a0b70c59a94 --- /dev/null +++ b/docs/product/sentry-toolbar/index.mdx @@ -0,0 +1,46 @@ +--- +title: Sentry Toolbar +sidebar_order: 120 +description: "Bring critical Sentry insights and tools directly into your web app for easier troubleshooting with the Sentry Toolbar." +--- + + + The Sentry Toolbar is currently in **beta**. Beta features are still in progress and may have bugs. Please reach out on + [GitHub](https://github.com/getsentry/sentry-toolbar/issues) if you have any feedback or concerns. + + +Developers spend a lot of time troubleshooting their web apps on local, staging, and production environments. The Sentry 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 Sentry 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. + +![Collapsed Toolbar in context of a website](./img/toolbar-collapsed.png) + +## Issues Panel + +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 Sentry Toolbar, you can quickly jump into specific issues in Sentry to get more detailed information (examples: Sentry project, issue title, description, and when the issue was first and last seen) and take action (examples: 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. + +![Toolbar with the Issues Panel open](./img/issues-panel.png) + +## Feedback Panel + +The feedback panel shows you the most recent user feedback messages for the page you are on, so you can more easily contextualize it. 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. + +![Toolbar with the Feedback Panel open](./img/feedback-panel.png) + +## Feature Flags Panel + +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/sentry-toolbar/setup/#implement-feature-flag-adapter) and [what data Sentry can track](/product/explore/feature-flags/) related to your feature flagging system. + + +![Toolbar with the Feature Flags Panel open](./img/feature-flags-panel.png) + +## Login Flow + +After setting up the Sentry 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. +![Toolbar login button](./img/login-button.png) + +After clicking the button, you will see a pop-up window for logging in to Sentry. +![Sentry log in pop up](./img/login-popup.png) + +If it's your first time [setting up the Sentry Toolbar](/product/sentry-toolbar/setup) , there will be a button with a link to Sentry's Toolbar settings page to configure your domain. +![Toolbar configure domains button](./img/configure-domain.png) + +Learn more about setting up the Toolbar, including configuring a feature flag provider and integrating the toolbar in different environments, on the next page. diff --git a/docs/product/dev-toolbar/setup.mdx b/docs/product/sentry-toolbar/setup.mdx similarity index 52% rename from docs/product/dev-toolbar/setup.mdx rename to docs/product/sentry-toolbar/setup.mdx index f3564a916f705..734f53887ac1d 100644 --- a/docs/product/dev-toolbar/setup.mdx +++ b/docs/product/sentry-toolbar/setup.mdx @@ -1,125 +1,151 @@ --- -title: "Set Up Dev Toolbar" +title: "Set Up Sentry Toolbar" sidebar_order: 10 -description: "Get started with Sentry's Dev Toolbar, bringing critical Sentry insights and tools into your web app to help your team troubleshoot more effectively." +description: "Get started with Sentry's Toolbar, bringing critical Sentry insights and tools into your web app to help your team troubleshoot more effectively." --- - The Dev Toolbar is currently in **beta**. Beta features are still in progress and may have bugs. Please reach out on + The Sentry Toolbar is currently in **beta**. Beta features are still in progress and may have bugs. Please reach out on [GitHub](https://github.com/getsentry/sentry-toolbar/issues) if you have any feedback or concerns. ## Pre-Requisites -For the Sentry Dev Toolbar to work best, [enable tracing](/platforms/javascript/tracing/) in your app. With tracing enabled, the Dev Toolbar will be able to associate issues and feedback with the current URL in the browser location. +For the Sentry Toolbar to work best, [enable tracing](/platforms/javascript/tracing/) in your app. With tracing enabled, the Sentry Toolbar will be able to associate issues and feedback with the current URL in the browser location. -## 1. Choose Deploy Environments +## 1. Allow Domains -Since the Dev Toolbar will be visible to users within your app, it's important to consider which environments should render it. +Since the Sentry Toolbar will be visible to users within your app, it's important to consider which environments should render it. See the [FAQ: _"In what environments should I enable the Sentry Toolbar?"_](/product/sentry-toolbar/faq/#in-what-environments-should-i-enable-the-dev-toolbar) for tips. -In dev and staging environments, 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. +You will need to edit the [Project Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/) page to allow the Toolbar to connect to Sentry. Add any production, staging, or development domains to the list. Only add domains that you trust and control to this list. -In production environments, the Dev Toolbar can make it easier to reproduce real issues your users are having. However the Toolbar should not be rendered for all users of the site -- only when an employee/engineer/etc visits. +![Sentry's Toolbar Settings Page](./img/sentry-project-settings-toolbar.png) -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. +## 2. Install -For example, the conditions to show show the Toolbar in dev and staging might look like this: +If you are developing a React based application, it's time to add the Toolbar into your `package.json` file. -```typescript -const env = process.env.SENTRY_ENVIRONMENT || 'development'; +Or, you can skip ahead to the next step to find the CDN configuration instructions. -const isDev = env === 'development' || env === 'staging'; -if (isDev) { - // Enable the Dev Toolbar here... -} +```bash {tabTitle: npm} +npm install --save @sentry/toolbar +``` +```bash {tabTitle: yarn} +yarn add @sentry/toolbar ``` -Or if your web application requires authentication to access, you could add a conditional where the Dev Toolbar is shown always when deployed to development **and** staging, but in production only show the Toolbar **if** an employee is logged in. - -## 2. Allow Domains - -You will need to edit the [Project Settings](https://sentry.io/orgredirect/organizations/:orgslug/settings/projects/) page to allow the Toolbar to connect to Sentry by configuring your dev, staging, and production domains. Only add domains that you trust and control to this list. +## 3. Configure -![Sentry's Dev Toolbar Settings Page](./img/sentry-project-settings-toolbar.png) +Finally, whether you have a React application or are loading the Toolbar from the CDN, you need to initialize the Toolbar using JavaScript. This will prompt any visitor to login to your Sentry organization. -## 3. Install +```javascript {tabTitle: React} +import {useSentryToolbar} from '@sentry/toolbar'; -Next you must include the Toolbar code in your app: +useSentryToolbar({ + // Remember to conditionally enable the Toolbar. + // This will reduce network traffic for users + // who do not have credentials to login to Sentry. + enabled, -```html {tabTitle: CDN} - - -``` -```typescript {tabTitle: React} -// An NPM package is under development -// In the meantime, go here for instructions to create a React hook manually: -// https://github.com/getsentry/sentry-toolbar/blob/main/docs/conditional-script.md + initProps: { + organizationSlug: 'acme', + projectIdOrSlug: 'website', + }, +}) ``` - -Remember to conditionally include the Toolbar code only in environments that need it. This will help reduce network traffic for your users who do not have the credentials needed to login. - -## 4. Configure - -Finally, call `SentryToolbar.init(initConfig)` to render a Toolbar instance on each page where you want to see the Dev Toolbar. This will prompt any visitor to the page to login to your Sentry organization. - ```html {tabTitle: CDN} ... ... + ``` -```typescript {tabTitle:React} -// An NPM package is under development -// In the meantime, go here for instructions to create a React hook manually: -// https://github.com/getsentry/sentry-toolbar/blob/main/docs/conditional-script.md -``` - -If the toolbar `