123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234 |
- import {Fragment} from 'react';
- import ExternalLink from 'sentry/components/links/externalLink';
- import List from 'sentry/components/list';
- import ListItem from 'sentry/components/list/listItem';
- import crashReportCallout from 'sentry/components/onboarding/gettingStartedDoc/feedback/crashReportCallout';
- import TracePropagationMessage from 'sentry/components/onboarding/gettingStartedDoc/replay/tracePropagationMessage';
- import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
- import type {
- Docs,
- DocsParams,
- OnboardingConfig,
- } from 'sentry/components/onboarding/gettingStartedDoc/types';
- import {
- getFeedbackConfigureDescription,
- getFeedbackSDKSetupSnippet,
- } from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
- import {getJSMetricsOnboarding} from 'sentry/components/onboarding/gettingStartedDoc/utils/metricsOnboarding';
- import {
- getReplayConfigureDescription,
- getReplaySDKSetupSnippet,
- } from 'sentry/components/onboarding/gettingStartedDoc/utils/replayOnboarding';
- import {t, tct} from 'sentry/locale';
- type Params = DocsParams;
- const getConfigStep = () => [
- {
- description: tct(
- 'Configure your app automatically with the [wizardLink:Sentry wizard].',
- {
- wizardLink: (
- <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/remix/#install" />
- ),
- }
- ),
- language: 'bash',
- code: `npx @sentry/wizard@latest -i remix`,
- },
- ];
- const getInstallConfig = () => [
- {
- type: StepType.INSTALL,
- configurations: getConfigStep(),
- },
- ];
- const onboarding: OnboardingConfig = {
- introduction: () =>
- tct("Sentry's integration with [remixLink:Remix] supports Remix 1.0.0 and above.", {
- remixLink: <ExternalLink href="https://remix.run/" />,
- }),
- install: () => getInstallConfig(),
- configure: () => [
- {
- type: StepType.CONFIGURE,
- description: t(
- 'The Sentry wizard will automatically add code to your project to inialize and configure the Sentry SDK:'
- ),
- configurations: [
- {
- description: (
- <List symbol="bullet">
- <ListItem>
- {tct(
- "Create two files in the root directory of your project, [clientEntry:entry.client.tsx] and [serverEntry:entry.server.tsx] (if they don't already exist).",
- {
- clientEntry: <code />,
- serverEntry: <code />,
- }
- )}
- </ListItem>
- <ListItem>
- {tct(
- 'Add the default [sentryInitCode:Sentry.init] call to both, client and server entry files.',
- {
- sentryInitCode: <code />,
- }
- )}
- </ListItem>
- <ListItem>
- {tct(
- 'Create a [cliRc:.sentryclirc] with an auth token to upload source maps (this file is automatically added to your [gitignore:.gitignore]).',
- {
- cliRc: <code />,
- gitignore: <code />,
- }
- )}
- </ListItem>
- <ListItem>
- {tct(
- 'Adjust your [buildscript:build] script in your [pkgJson:package.json] to automatically upload source maps to Sentry when you build your application.',
- {
- buildscript: <code />,
- pkgJson: <code />,
- }
- )}
- </ListItem>
- </List>
- ),
- },
- {
- description: tct(
- 'You can also further [manualConfigure:configure your SDK] or [manualSetupLink:set it up manually], without the wizard.',
- {
- manualConfigure: (
- <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/remix/manual-setup/#configuration" />
- ),
- manualSetupLink: (
- <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/remix/manual-setup/" />
- ),
- }
- ),
- },
- ],
- },
- ],
- verify: () => [],
- nextSteps: () => [
- {
- id: 'performance-monitoring',
- name: t('Performance Monitoring'),
- description: t(
- 'Track down transactions to connect the dots between 10-second page loads and poor-performing API calls or slow database queries.'
- ),
- link: 'https://docs.sentry.io/platforms/javascript/guides/remix/performance/',
- },
- {
- id: 'session-replay',
- name: t('Session Replay'),
- description: t(
- 'Get to the root cause of an error or latency issue faster by seeing all the technical details related to that issue in one visual replay on your web application.'
- ),
- link: 'https://docs.sentry.io/platforms/javascript/guides/remix/session-replay/',
- },
- ],
- };
- const replayOnboarding: OnboardingConfig = {
- install: () => getInstallConfig(),
- configure: (params: Params) => [
- {
- type: StepType.CONFIGURE,
- description: getReplayConfigureDescription({
- link: 'https://docs.sentry.io/platforms/javascript/guides/remix/session-replay/',
- }),
- configurations: [
- {
- code: [
- {
- label: 'JavaScript',
- value: 'javascript',
- language: 'javascript',
- code: getReplaySDKSetupSnippet({
- importStatement: `import * as Sentry from "@sentry/remix";`,
- dsn: params.dsn,
- mask: params.replayOptions?.mask,
- block: params.replayOptions?.block,
- }),
- },
- ],
- },
- ],
- additionalInfo: (
- <Fragment>
- <TracePropagationMessage />
- {tct(
- 'Note: The Replay integration only needs to be added to your [entryClient:entry.client.tsx] file. It will not run if it is added into [sentryServer:sentry.server.config.js].',
- {entryClient: <code />, sentryServer: <code />}
- )}
- </Fragment>
- ),
- },
- ],
- verify: () => [],
- nextSteps: () => [],
- };
- const feedbackOnboarding: OnboardingConfig = {
- install: () => [
- {
- type: StepType.INSTALL,
- description: tct(
- 'For the User Feedback integration to work, you must have the Sentry browser SDK package, or an equivalent framework SDK (e.g. [code:@sentry/remix]) installed, minimum version 7.85.0.',
- {
- code: <code />,
- }
- ),
- configurations: getConfigStep(),
- },
- ],
- configure: (params: Params) => [
- {
- type: StepType.CONFIGURE,
- description: getFeedbackConfigureDescription({
- linkConfig:
- 'https://docs.sentry.io/platforms/javascript/guides/remix/user-feedback/configuration/',
- linkButton:
- 'https://docs.sentry.io/platforms/javascript/guides/remix/user-feedback/configuration/#bring-your-own-button',
- }),
- configurations: [
- {
- code: [
- {
- label: 'JavaScript',
- value: 'javascript',
- language: 'javascript',
- code: getFeedbackSDKSetupSnippet({
- importStatement: `import * as Sentry from "@sentry/remix";`,
- dsn: params.dsn,
- feedbackOptions: params.feedbackOptions,
- }),
- },
- ],
- },
- ],
- additionalInfo: crashReportCallout({
- link: 'https://docs.sentry.io/platforms/javascript/guides/remix/user-feedback/#user-feedback-api',
- }),
- },
- ],
- verify: () => [],
- nextSteps: () => [],
- };
- const docs: Docs = {
- onboarding,
- feedbackOnboardingNpm: feedbackOnboarding,
- replayOnboardingNpm: replayOnboarding,
- customMetricsOnboarding: getJSMetricsOnboarding({getInstallConfig}),
- };
- export default docs;
|