sveltekit.tsx 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. import {Fragment} from 'react';
  2. import ExternalLink from 'sentry/components/links/externalLink';
  3. import List from 'sentry/components/list/';
  4. import ListItem from 'sentry/components/list/listItem';
  5. import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/step';
  6. import {
  7. Docs,
  8. OnboardingConfig,
  9. } from 'sentry/components/onboarding/gettingStartedDoc/types';
  10. import {t, tct} from 'sentry/locale';
  11. const onboarding: OnboardingConfig = {
  12. install: () => [
  13. {
  14. type: StepType.INSTALL,
  15. configurations: [
  16. {
  17. description: tct(
  18. 'Configure your app automatically with the [wizardLink:Sentry wizard].',
  19. {
  20. wizardLink: (
  21. <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/sveltekit/#install" />
  22. ),
  23. }
  24. ),
  25. language: 'bash',
  26. code: `npx @sentry/wizard@latest -i sveltekit`,
  27. },
  28. ],
  29. },
  30. ],
  31. configure: () => [
  32. {
  33. type: StepType.CONFIGURE,
  34. configurations: [
  35. {
  36. description: (
  37. <Fragment>
  38. {t(
  39. 'The Sentry wizard will automatically patch your application to configure the Sentry SDK:'
  40. )}
  41. <List symbol="bullet">
  42. <ListItem>
  43. {tct(
  44. 'Create or update [hookClientCode:src/hooks.client.js] and [hookServerCode:src/hooks.server.js] with the default [sentryInitCode:Sentry.init] call and SvelteKit hooks handlers.',
  45. {
  46. hookClientCode: <code />,
  47. hookServerCode: <code />,
  48. sentryInitCode: <code />,
  49. }
  50. )}
  51. </ListItem>
  52. <ListItem>
  53. {tct(
  54. 'Update [code:vite.config.js] to add source maps upload and auto-instrumentation via Vite plugins.',
  55. {
  56. code: <code />,
  57. }
  58. )}
  59. </ListItem>
  60. <ListItem>
  61. {tct(
  62. 'Create [sentryClircCode:.sentryclirc] and [sentryPropertiesCode:sentry.properties] files with configuration for sentry-cli (which is used when automatically uploading source maps).',
  63. {
  64. sentryClircCode: <code />,
  65. sentryPropertiesCode: <code />,
  66. }
  67. )}
  68. </ListItem>
  69. </List>
  70. <p>
  71. {tct(
  72. 'Alternatively, you can also [manualSetupLink:set up the SDK manually].',
  73. {
  74. manualSetupLink: (
  75. <ExternalLink href="https://docs.sentry.io/platforms/javascript/guides/sveltekit/manual-setup/" />
  76. ),
  77. }
  78. )}
  79. </p>
  80. </Fragment>
  81. ),
  82. },
  83. ],
  84. },
  85. ],
  86. verify: () => [],
  87. };
  88. const docs: Docs = {
  89. onboarding,
  90. };
  91. export default docs;