}
),
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: `module.exports = {
plugins: [{
resolve: "@sentry/gatsby",
}],
};`,
},
],
},
{
description: tct('Then, configure your [codeSentry:Sentry.init:]', {
codeSentry:
,
}),
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getSdkSetupSnippet(params),
},
],
},
...(params.isProfilingSelected
? [getProfilingDocumentHeaderConfigurationStep()]
: []),
],
};
};
const getInstallConfig = () => [
{
language: 'bash',
code: [
{
label: 'npm',
value: 'npm',
language: 'bash',
code: 'npm install --save @sentry/gatsby',
},
{
label: 'yarn',
value: 'yarn',
language: 'bash',
code: 'yarn add @sentry/gatsby',
},
],
},
];
const onboarding: OnboardingConfig = {
introduction: params => (
{tct('In this quick guide you’ll use [strong:npm] or [strong:yarn] to set up:', { strong: , })}
,
}
),
configurations: getInstallConfig(),
},
],
configure: (params: Params) => [
getConfigureStep(params),
getUploadSourceMapsStep({
guideLink: 'https://docs.sentry.io/platforms/javascript/guides/gatsby/sourcemaps/',
...params,
}),
],
verify: () => [
{
type: StepType.VERIFY,
description: t(
"This snippet contains an intentional error and can be used as a test to make sure that everything's working as expected."
),
configurations: [
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getVerifySnippet(),
},
],
},
],
},
],
nextSteps: () => [],
};
const replayOnboarding: OnboardingConfig = {
install: () => [
{
type: StepType.INSTALL,
description: tct(
'You need a minimum version 7.27.0 of [code:@sentry/gatsby] in order to use Session Replay. You do not need to install any additional packages.',
{
code:
,
}
),
configurations: getInstallConfig(),
},
],
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
description: getReplayConfigureDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/gatsby/session-replay/',
}),
configurations: [getConfigureStep(params)],
additionalInfo: (
,
}
)}
,
}
),
configurations: getInstallConfig(),
},
],
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
description: getFeedbackConfigureDescription({
linkConfig:
'https://docs.sentry.io/platforms/javascript/guides/gatsby/user-feedback/configuration/',
linkButton:
'https://docs.sentry.io/platforms/javascript/guides/gatsby/user-feedback/configuration/#bring-your-own-button',
}),
configurations: [
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getSdkSetupSnippet(params),
},
],
},
],
additionalInfo: crashReportCallout({
link: 'https://docs.sentry.io/platforms/javascript/guides/gatsby/user-feedback/#crash-report-modal',
}),
},
],
verify: () => [],
nextSteps: () => [],
};
const crashReportOnboarding: OnboardingConfig = {
introduction: () => getCrashReportModalIntroduction(),
install: (params: Params) => getCrashReportJavaScriptInstallStep(params),
configure: () => [
{
type: StepType.CONFIGURE,
description: getCrashReportModalConfigDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/gatsby/user-feedback/configuration/#crash-report-modal',
}),
additionalInfo: widgetCallout({
link: 'https://docs.sentry.io/platforms/javascript/guides/gatsby/user-feedback/#user-feedback-widget',
}),
},
],
verify: () => [],
nextSteps: () => [],
};
const profilingOnboarding: OnboardingConfig = {
...onboarding,
introduction: params =>