You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ref(sveltekit): Adjust Cloudflare setup to only use SvelteKit SDK (#12801)
* ref(sveltekit): Adjust cloudflare setup to only use SvelteKit SDK
* more linking, rewording
* Apply suggestions from code review
Co-authored-by: Alex Krawiec <[email protected]>
---------
Co-authored-by: Alex Krawiec <[email protected]>
description: "Learn how to add Cloudflare instrumentation to your SvelteKit app."
4
4
---
5
5
6
-
If you're running your SvelteKit app on Cloudflare Pages, you can use the Sentry SvelteKit SDK in combination with the Sentry Cloudflare SDK to add Sentry instrumentation.
6
+
If you're running your SvelteKit app on Cloudflare Pages, you need to configure the SDK a little differently to the default setup. This guide will show you how to set up the Sentry SvelteKit SDK for Cloudflare Pages.
7
+
8
+
## 1. Install the SDK
7
9
8
10
First, install the Sentry SvelteKit SDK in your application. We recommend using the Sentry wizard to automatically install the SDK:
If the setup through the wizard doesn't work for you, you can also [set up the SvelteKit SDK manually](/platforms/javascript/guides/sveltekit/manual-setup/).
15
17
16
-
After installing the Sentry SvelteKit SDK, you can move on to setting up the Cloudflare SDK. First, install the SDK with your package manager:
18
+
<Alert>
19
+
20
+
If installed the SDK before, make sure that `@sentry/sveltekit` version `9.2.0` or newer is installed.
To use this SDK, update your `src/hooks.server.(ts|js)` file to use the `Sentry.wrapRequestHandler` method from the Sentry Cloudflare SDK and remove the `Sentry.init` call from `@sentry/sveltekit`.
34
+
## 3. Update Your Server Hooks File
35
+
36
+
To use this SDK, update your `src/hooks.server.(ts|js)` file to use the `initCloudflareSentryHandle` method from the Sentry Cloudflare SDK and remove the `Sentry.init` call from `@sentry/sveltekit`.
0 commit comments