|
@@ -4,6 +4,7 @@ import styled from '@emotion/styled';
|
|
|
import ExternalLink from 'sentry/components/links/externalLink';
|
|
|
import List from 'sentry/components/list/';
|
|
|
import ListItem from 'sentry/components/list/listItem';
|
|
|
+import {CopyDsnField} from 'sentry/components/onboarding/gettingStartedDoc/copyDsnField';
|
|
|
import crashReportCallout from 'sentry/components/onboarding/gettingStartedDoc/feedback/crashReportCallout';
|
|
|
import widgetCallout from 'sentry/components/onboarding/gettingStartedDoc/feedback/widgetCallout';
|
|
|
import TracePropagationMessage from 'sentry/components/onboarding/gettingStartedDoc/replay/tracePropagationMessage';
|
|
@@ -26,11 +27,9 @@ import {
|
|
|
getReplaySDKSetupSnippet,
|
|
|
getReplayVerifyStep,
|
|
|
} from 'sentry/components/onboarding/gettingStartedDoc/utils/replayOnboarding';
|
|
|
-import TextCopyInput from 'sentry/components/textCopyInput';
|
|
|
import {featureFlagOnboarding} from 'sentry/gettingStartedDocs/javascript/javascript';
|
|
|
import {t, tct} from 'sentry/locale';
|
|
|
import {space} from 'sentry/styles/space';
|
|
|
-import {trackAnalytics} from 'sentry/utils/analytics';
|
|
|
|
|
|
type Params = DocsParams;
|
|
|
|
|
@@ -83,68 +82,67 @@ const onboarding: OnboardingConfig = {
|
|
|
configurations: getInstallConfig(params),
|
|
|
},
|
|
|
],
|
|
|
- configure: () => [
|
|
|
+ configure: params => [
|
|
|
{
|
|
|
title: t('Manual Configuration'),
|
|
|
collapsible: true,
|
|
|
+ description: tct(
|
|
|
+ 'Alternatively, you can also [manualSetupLink:set up the SDK manually], by following these steps:',
|
|
|
+ {
|
|
|
+ manualSetupLink: (
|
|
|
+ <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/" />
|
|
|
+ ),
|
|
|
+ }
|
|
|
+ ),
|
|
|
configurations: [
|
|
|
{
|
|
|
description: (
|
|
|
- <Fragment>
|
|
|
- <p>
|
|
|
+ <List symbol="bullet">
|
|
|
+ <ListItem>
|
|
|
+ {tct(
|
|
|
+ 'Create [code:sentry.server.config.js], [code:sentry.client.config.js] and [code:sentry.edge.config.js] with the default [code:Sentry.init].',
|
|
|
+ {
|
|
|
+ code: <code />,
|
|
|
+ }
|
|
|
+ )}
|
|
|
+ </ListItem>
|
|
|
+ <ListItem>
|
|
|
+ {tct(
|
|
|
+ 'Create or update the Next.js instrumentation file [instrumentationCode:instrumentation.ts] to initialize the SDK with the configuration files added in the previous step.',
|
|
|
+ {
|
|
|
+ instrumentationCode: <code />,
|
|
|
+ }
|
|
|
+ )}
|
|
|
+ </ListItem>
|
|
|
+ <ListItem>
|
|
|
{tct(
|
|
|
- 'Alternatively, you can also [manualSetupLink:set up the SDK manually], by following these steps:',
|
|
|
+ 'Create or update your Next.js config [nextConfig:next.config.js] with the default Sentry configuration.',
|
|
|
{
|
|
|
- manualSetupLink: (
|
|
|
- <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/" />
|
|
|
- ),
|
|
|
+ nextConfig: <code />,
|
|
|
}
|
|
|
)}
|
|
|
- </p>
|
|
|
- <List symbol="bullet">
|
|
|
- <ListItem>
|
|
|
- {tct(
|
|
|
- 'Create [code:sentry.server.config.js], [code:sentry.client.config.js] and [code:sentry.edge.config.js] with the default [code:Sentry.init].',
|
|
|
- {
|
|
|
- code: <code />,
|
|
|
- }
|
|
|
- )}
|
|
|
- </ListItem>
|
|
|
- <ListItem>
|
|
|
- {tct(
|
|
|
- 'Create or update the Next.js instrumentation file [instrumentationCode:instrumentation.ts] to initialize the SDK with the configuration files added in the previous step.',
|
|
|
- {
|
|
|
- instrumentationCode: <code />,
|
|
|
- }
|
|
|
- )}
|
|
|
- </ListItem>
|
|
|
- <ListItem>
|
|
|
- {tct(
|
|
|
- 'Create or update your Next.js config [nextConfig:next.config.js] with the default Sentry configuration.',
|
|
|
- {
|
|
|
- nextConfig: <code />,
|
|
|
- }
|
|
|
- )}
|
|
|
- </ListItem>
|
|
|
- <ListItem>
|
|
|
- {tct(
|
|
|
- 'Create a [bundlerPluginsEnv:.env.sentry-build-plugin] with an auth token (which is used to upload source maps when building the application).',
|
|
|
- {
|
|
|
- bundlerPluginsEnv: <code />,
|
|
|
- }
|
|
|
- )}
|
|
|
- </ListItem>
|
|
|
- <ListItem>
|
|
|
- {t('Add an example page to your app to verify your Sentry setup.')}
|
|
|
- </ListItem>
|
|
|
- </List>
|
|
|
- </Fragment>
|
|
|
+ </ListItem>
|
|
|
+ <ListItem>
|
|
|
+ {tct(
|
|
|
+ 'Create a [bundlerPluginsEnv:.env.sentry-build-plugin] with an auth token (which is used to upload source maps when building the application).',
|
|
|
+ {
|
|
|
+ bundlerPluginsEnv: <code />,
|
|
|
+ }
|
|
|
+ )}
|
|
|
+ </ListItem>
|
|
|
+ <ListItem>
|
|
|
+ {t('Add an example page to your app to verify your Sentry setup.')}
|
|
|
+ </ListItem>
|
|
|
+ </List>
|
|
|
),
|
|
|
},
|
|
|
+ {
|
|
|
+ description: <CopyDsnField params={params} />,
|
|
|
+ },
|
|
|
],
|
|
|
},
|
|
|
],
|
|
|
- verify: (params: Params) => [
|
|
|
+ verify: () => [
|
|
|
{
|
|
|
type: StepType.VERIFY,
|
|
|
description: (
|
|
@@ -183,28 +181,6 @@ const onboarding: OnboardingConfig = {
|
|
|
'If you see an issue in your Sentry dashboard, you have successfully set up Sentry with Next.js.'
|
|
|
)}
|
|
|
</p>
|
|
|
- <Divider />
|
|
|
- <DSNText>
|
|
|
- <p>
|
|
|
- {tct(
|
|
|
- "If you already have the configuration for Sentry in your application, and just need this project's ([projectSlug]) DSN, you can find it below:",
|
|
|
- {
|
|
|
- projectSlug: <code>{params.projectSlug}</code>,
|
|
|
- }
|
|
|
- )}
|
|
|
- </p>
|
|
|
- </DSNText>
|
|
|
- {params.organization && (
|
|
|
- <TextCopyInput
|
|
|
- onCopy={() =>
|
|
|
- trackAnalytics('onboarding.nextjs-dsn-copied', {
|
|
|
- organization: params.organization,
|
|
|
- })
|
|
|
- }
|
|
|
- >
|
|
|
- {params.dsn.public}
|
|
|
- </TextCopyInput>
|
|
|
- )}
|
|
|
</Fragment>
|
|
|
),
|
|
|
},
|
|
@@ -430,21 +406,8 @@ const docs: Docs = {
|
|
|
|
|
|
export default docs;
|
|
|
|
|
|
-const DSNText = styled('div')`
|
|
|
- margin-bottom: ${space(0.5)};
|
|
|
-`;
|
|
|
-
|
|
|
const AdditionalInfoWrapper = styled('div')`
|
|
|
display: flex;
|
|
|
flex-direction: column;
|
|
|
gap: ${space(2)};
|
|
|
`;
|
|
|
-
|
|
|
-const Divider = styled('hr')`
|
|
|
- height: 1px;
|
|
|
- width: 100%;
|
|
|
- background: ${p => p.theme.border};
|
|
|
- border: none;
|
|
|
- margin-top: ${space(1)};
|
|
|
- margin-bottom: ${space(2)};
|
|
|
-`;
|