Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(cloudflare): Use correct setup snippets for Hydrogen #12608

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description: "Learn how to add Cloudflare instrumentation to your Remix app."

If you're running your Remix app on Cloudflare Pages, you can use the Sentry Remix SDK in combination with the Sentry Cloudflare SDK to add Sentry instrumentation.

## 1. Installing Sentry Remix SDK

First, install the Sentry Remix SDK in your application. We recommend using the Sentry wizard to automatically install the SDK:

```bash
Expand All @@ -13,6 +15,8 @@ npx @sentry/wizard@latest -i remix

If the setup through the wizard doesn't work for you, you can also [set up the Remix SDK manually](/platforms/javascript/guides/remix/manual-setup/).

## 2. Installing Sentry Cloudflare SDK

After installing the Sentry Remix SDK, delete the newly generated `instrumentation.server.mjs` file. This instrumentation is not needed when using the Cloudflare SDK.

Now you can install the Sentry Cloudflare SDK. First, install the SDK with your package manager:
Expand Down
17 changes: 16 additions & 1 deletion docs/platforms/javascript/guides/remix/frameworks/hydrogen.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ description: "Learn how to use the Sentry Remix SDK to instrument your Shopify H

If you're using the Shopify Hydrogen framework, you can use the Sentry Remix SDK to add Sentry instrumentation to your app.

## 1. Installing Sentry Remix SDK

First, install the Sentry Remix SDK in your application. We recommend using the Sentry wizard to automatically install the SDK:

```bash
Expand All @@ -13,11 +15,24 @@ npx @sentry/wizard@latest -i remix

If the wizard doesn't work for you, you can also [set up the Remix SDK manually](/platforms/javascript/guides/remix/manual-setup/).

## 2. Installing Sentry Cloudflare SDK

After installing the Sentry Remix SDK, delete the newly generated `instrumentation.server.mjs` file and all newly generated code from `entry.server.tsx`. This instrumentation is not needed because you are going to use the Sentry Cloudflare SDK for server-side instrumentation.

Now you can install the Sentry Cloudflare SDK. First, install the SDK with your package manager:

<PlatformContent includePath="getting-started-install" />
```bash {tabTitle:npm}
npm install @sentry/cloudflare --save
```

```bash {tabTitle:yarn}
yarn add @sentry/cloudflare
```

```bash {tabTitle:pnpm}
pnpm add @sentry/cloudflare
```


Then update your `server.ts` file to use the `wrapRequestHandler` method:

Expand Down
Loading