Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ export default Sentry.withSentry(App, useEffect, useLocation, useMatches);
Finally, update your `entry.client.tsx` file to initialize Sentry SDK on the client:

```tsx {filename:app/entry.client.tsx}
import * as Sentry from "@sentry/remix";
import * as Sentry from "@sentry/remix/cloudflare";
import { useEffect } from "react";
import { useLocation, useMatches } from "@remix-run/react";

Sentry.init({
dsn: "___PUBLIC_DSN___",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Nuxt on Cloudflare
description: "Learn how to instrument your Nuxt app on Cloudflare Workers and Pages and capture your first errors with Sentry. "
description: "Learn how to instrument your Nuxt app on Cloudflare Workers and Pages and capture your first errors with Sentry."
---

This guide will show you how to set up the SDK with Nitro's `cloudflare_module` (or their deprecated `cloudflare-pages`) deployment preset.
Expand Down
45 changes: 5 additions & 40 deletions docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx
Original file line number Diff line number Diff line change
@@ -1,44 +1,9 @@
---
title: Remix on Cloudflare
description: "Learn how to add Cloudflare instrumentation to your Remix app."
description: "Learn how to instrument your Remix app on Cloudflare Workers and Pages and capture your first errors with Sentry."
---

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.

## Install

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

```bash
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/).

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:

<PlatformContent includePath="getting-started-install" />

## Setup

The main Sentry configuration should happen as early as possible in your app's lifecycle.

<PlatformContent includePath="getting-started-config" />

Then create a `_middleware.js` file in your `functions` directory and add the following code:

```javascript {filename:functions/_middleware.js}
import * as Sentry from "@sentry/cloudflare";

export const onRequest = [
// Make sure Sentry is the first middleware
Sentry.sentryPagesPlugin((context) => ({
dsn: "___PUBLIC_DSN___",
// Set tracesSampleRate to 1.0 to capture 100% of spans for tracing.
tracesSampleRate: 1.0,
})),
// Add more middlewares here
];
```
<PlatformContent
includePath="getting-started-complete"
platform="javascript.remix"
/>
Loading
Loading