Skip to content

Commit 306eaaa

Browse files
committed
PR feedback Alex
1 parent 27b4ca4 commit 306eaaa

File tree

2 files changed

+32
-25
lines changed

2 files changed

+32
-25
lines changed

docs/platforms/javascript/guides/sveltekit/manual-setup.mdx

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,19 @@ You need:
1717
- Your application up and running
1818

1919
<Expandable title="Notes on SvelteKit adapter compatibility">
20-
The SvelteKit Sentry SDK is designed to work out of the box with the following SvelteKit adapters:
21-
22-
- [Adapter-auto](https://kit.svelte.dev/docs/adapter-auto) – for Vercel; other platforms might work but we don't guarantee compatibility at this time
23-
- [Adapter-vercel](https://kit.svelte.dev/docs/adapter-vercel) – only for Node (Lambda) runtimes, not yet Vercel's edge runtime
24-
- [Adapter-cloudflare](https://kit.svelte.dev/docs/adapter-cloudflare) – supported but requires [additional setup](https://docs.sentry.io/platforms/javascript/guides/cloudflare/frameworks/sveltekit/)
25-
- [Adapter-node](https://kit.svelte.dev/docs/adapter-node)
26-
27-
Other adapters may work but aren't currently supported. We're looking into extending first-class support to more adapters in the future.
28-
29-
Also, Sentry's SvelteKit SDK does not yet work with all non-node server runtimes, such as Vercel's edge runtime.
20+
The SvelteKit Sentry SDK is designed to work out of the box with several SvelteKit adapters and their underlying server runtimes.
21+
Here's an overview of the current support:
22+
23+
- **Fully supported Node.js runtimes**
24+
- [Adapter-auto](https://kit.svelte.dev/docs/adapter-auto) for Vercel; other Node.js-based platforms might work, but we don't guarantee compatibility at this time
25+
- [Adapter-vercel](https://kit.svelte.dev/docs/adapter-vercel) when used with Vercel's Node.js Lambda runtime
26+
- [Adapter-node](https://kit.svelte.dev/docs/adapter-node)
27+
- **Supported non-Node.js runtimes**
28+
- [Adapter-cloudflare](https://kit.svelte.dev/docs/adapter-cloudflare) requires [additional setup](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/)
29+
- **Currently not supported**
30+
- Non-Node.js server runtimes, such as Vercel's edge runtime, are not yet supported.
31+
- **Other adapters**
32+
- Other SvelteKit adapters might work, but they're not currently officially supported. We're looking into extending first-class support to more adapters in the future.
3033

3134
</Expandable>
3235

@@ -62,9 +65,9 @@ If you're updating your Sentry SDK to the latest version, check out our [migrati
6265

6366
You need to initialize and configure the Sentry SDK in three places: the client side, the server side, and your Vite config.
6467

65-
### Configure Client-side Sentry
68+
### Configure Client-Side Sentry
6669

67-
Create a client hooks file `src/hooks.client.(js|ts)` if you don't have one already. In this file, import and initialize the Sentry SDK and add the `handleErrorWithSentry` function to the [`handleError` hook](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError).
70+
Create a client hooks file `src/hooks.client.(js|ts)` in the `src` folder of your project if you don't have one already. In this file, import and initialize the Sentry SDK and add the `handleErrorWithSentry` function to the [`handleError` hook](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError).
6871

6972
```javascript {filename:hooks.client.(js|ts)} {1, 3-28, 34}
7073
import * as Sentry from "@sentry/sveltekit";
@@ -106,9 +109,9 @@ export const handleError = Sentry.handleErrorWithSentry(myErrorHandler);
106109
// export const handleError = handleErrorWithSentry();
107110
```
108111

109-
### Configure Server-side Sentry
112+
### Configure Server-Side Sentry
110113

111-
Create a server hooks file `src/hooks.server.(js|ts)` if you don't have one already. In this file, import and initialize the Sentry SDK and add the `handleErrorWithSentry` function to the [`handleError` hook](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) and the Sentry request handler to the [`handle` hook](https://kit.svelte.dev/docs/hooks#server-hooks-handle).
114+
Create a server hooks file `src/hooks.server.(js|ts)` in the `src` folder of your project if you don't have one already. In this file, import and initialize the Sentry SDK and add the `handleErrorWithSentry` function to the [`handleError` hook](https://svelte.dev/docs/kit/hooks#Shared-hooks-handleError) and the Sentry request handler to the [`handle` hook](https://kit.svelte.dev/docs/hooks#server-hooks-handle).
112115

113116
```javascript {filename:hooks.server.(js|ts)} {1, 3-18, 24, 28}
114117
import * as Sentry from "@sentry/sveltekit";
@@ -146,7 +149,8 @@ export const handle = Sentry.sentryHandle();
146149
<Alert level="warning" title="Important">
147150
For development, you can include your [Data Source
148151
Name](/concepts/key-terms/dsn-explainer/) (DSN) directly in these files.
149-
However, in production, we strongly recommend you use an environment variable.
152+
However, in production, we strongly recommend you use an environment variable
153+
to avoid accidentally exposing your DSN in the codebase.
150154
</Alert>
151155

152156
### Configure Vite
@@ -421,7 +425,7 @@ export const GET = wrapServerRouteWithSentry(async () => {
421425
});
422426
```
423427

424-
## Step 4: Cloudflare Pages Configuration (optional)
428+
## Step 4: Cloudflare Pages Configuration (Optional)
425429

426430
If you're deploying your application to Cloudflare Pages, you need to adjust your server-side setup.
427431
Follow this guide to [configure Sentry for Cloudflare](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/).

platform-includes/getting-started-prerequisites/javascript.sveltekit.mdx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@ You need:
88
- Vite version `4.2`+
99

1010
<Expandable title="Notes on SvelteKit adapter compatibility">
11-
The SvelteKit Sentry SDK is designed to work out of the box with the following SvelteKit adapters:
11+
The SvelteKit Sentry SDK is designed to work out of the box with several SvelteKit adapters and their underlying server runtimes.
12+
Here's an overview of the current support:
1213

13-
- [Adapter-auto](https://kit.svelte.dev/docs/adapter-auto) – for Vercel; other platforms might work but we don't guarantee compatibility at this time
14-
- [Adapter-vercel](https://kit.svelte.dev/docs/adapter-vercel) – only for Node (Lambda) runtimes, not yet Vercel's edge runtime
15-
- [Adapter-cloudflare](https://kit.svelte.dev/docs/adapter-cloudflare) – supported but requires [additional setup](https://docs.sentry.io/platforms/javascript/guides/cloudflare/frameworks/sveltekit/)
16-
- [Adapter-node](https://kit.svelte.dev/docs/adapter-node)
17-
18-
Other adapters may work but aren't currently supported. We're looking into extending first-class support to more adapters in the future.
19-
20-
Also, Sentry's SvelteKit SDK does not yet work with all non-node server runtimes, such as Vercel's edge runtime.
14+
- **Fully supported Node.js runtimes**
15+
- [Adapter-auto](https://kit.svelte.dev/docs/adapter-auto) for Vercel; other Node.js-based platforms might work, but we don't guarantee compatibility at this time
16+
- [Adapter-vercel](https://kit.svelte.dev/docs/adapter-vercel) when used with Vercel's Node.js Lambda runtime
17+
- [Adapter-node](https://kit.svelte.dev/docs/adapter-node)
18+
- **Supported non-Node.js runtimes**
19+
- [Adapter-cloudflare](https://kit.svelte.dev/docs/adapter-cloudflare) requires [additional setup](/platforms/javascript/guides/cloudflare/frameworks/sveltekit/)
20+
- **Currently not supported**
21+
- Non-Node.js server runtimes, such as Vercel's edge runtime, are not yet supported.
22+
- **Other adapters**
23+
- Other SvelteKit adapters might work, but they're not currently officially supported. We're looking into extending first-class support to more adapters in the future.
2124

2225
</Expandable>

0 commit comments

Comments
 (0)