,
}
),
configurations: [
{
language: 'bash',
code: [
{
label: 'bash',
value: 'bash',
language: 'bash',
code: `npx astro add @sentry/astro`,
},
],
},
],
},
];
const onboarding: OnboardingConfig = {
introduction: () => (
{tct(
"Sentry's integration with [astroLink:Astro] supports Astro 3.0.0 and above.",
{
astroLink:
{tct("In this quick guide you'll use the [astrocli:astro] CLI to set up:", { astrocli: , })}
,
}
),
configurations: [
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getSdkSetupSnippet(params),
},
],
},
{
description: tct(
'Add your Sentry auth token to the [authTokenEnvVar:SENTRY_AUTH_TOKEN] environment variable:',
{
authTokenEnvVar:
,
}
),
language: 'bash',
code: [
{
value: 'bash',
language: 'bash',
label: 'bash',
code: `SENTRY_AUTH_TOKEN=___ORG_AUTH_TOKEN___`,
},
],
},
{
description: tct(
'You can further customize your SDK by [manualSetupLink:manually inializing the SDK].',
{
manualSetupLink: (
{t( "If you're new to Sentry, use the email alert to access your account and complete a product tour." )}
{t( "If you're an existing user and have disabled alerts, you won't receive this email." )}
,
}
),
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
filename: 'astro.config.js',
code: `
import { defineConfig } from "astro/config";
import sentry from "@sentry/astro";
export default defineConfig({
integrations: [
sentry({
dsn: "${params.dsn.public}",
replaysSessionSampleRate: 0.2, // defaults to 0.1
replaysOnErrorSampleRate: 1.0, // defaults to 1.0
}),
],
});
`,
},
],
additionalInfo: tct(
'Further Replay options, like privacy settings, can be set in a [code:sentry.client.config.js] file:',
{
code:
,
}
),
},
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
filename: 'sentry.client.config.js',
code: getReplaySDKSetupSnippet({
importStatement: `// This file overrides \`astro.config.mjs\` for the browser-side.
// SDK options from \`astro.config.mjs\` will not apply.
import * as Sentry from "@sentry/astro";`,
dsn: params.dsn.public,
mask: params.replayOptions?.mask,
block: params.replayOptions?.block,
}),
},
],
additionalInfo: tct(
`Note that creating your own [code:sentry.client.config.js] file will override the default settings in your [code:astro.config.js] file. Learn more about this [link:here].`,
{
code:
,
link: (
,
}
),
configurations: getInstallConfig(),
},
],
configure: (params: Params) => [
{
type: StepType.CONFIGURE,
description: getFeedbackConfigureDescription({
linkConfig:
'https://docs.sentry.io/platforms/javascript/guides/astro/user-feedback/configuration/',
linkButton:
'https://docs.sentry.io/platforms/javascript/guides/astro/user-feedback/configuration/#bring-your-own-button',
}),
configurations: [
{
code: [
{
label: 'JavaScript',
value: 'javascript',
language: 'javascript',
code: getFeedbackSDKSetupSnippet({
importStatement: `import * as Sentry from "@sentry/astro";`,
dsn: params.dsn.public,
feedbackOptions: params.feedbackOptions,
}),
},
],
},
],
additionalInfo: crashReportCallout({
link: 'https://docs.sentry.io/platforms/javascript/guides/astro/user-feedback/#crash-report-modal',
}),
},
],
verify: () => [],
nextSteps: () => [],
};
const crashReportOnboarding: OnboardingConfig = {
introduction: () => getCrashReportModalIntroduction(),
install: (params: Params) => getCrashReportJavaScriptInstallStep(params),
configure: params => [
{
type: StepType.CONFIGURE,
description: getCrashReportModalConfigDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/astro/user-feedback/configuration/#crash-report-modal',
}),
additionalInfo: widgetCallout({
link: 'https://docs.sentry.io/platforms/javascript/guides/astro/user-feedback/#user-feedback-widget',
}),
...(params.isProfilingSelected
? [getProfilingDocumentHeaderConfigurationStep()]
: []),
},
],
verify: () => [],
nextSteps: () => [],
};
const docs: Docs = {
onboarding,
feedbackOnboardingNpm: feedbackOnboarding,
replayOnboarding,
customMetricsOnboarding: getJSMetricsOnboarding({getInstallConfig}),
crashReportOnboarding,
};
export default docs;