-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
docs(js): Update Remix on Cloudflare quick start guide #14873
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
76591c0
update Remix on Cloudflare quick start guide
inventarSarah a56d031
Merge branch 'master' of github.com:getsentry/sentry-docs into smi/qu…
inventarSarah 71bb2f6
Merge branch 'master' of github.com:getsentry/sentry-docs into smi/qu…
inventarSarah 2b0483f
update for cloudflare workers
inventarSarah 86d7861
Apply suggestions from code review
inventarSarah eed0186
Merge branch 'master' into smi/quick-start/cloudflare-remix
inventarSarah 44e1af7
Update Remix client usage
onurtemizkan f214ca5
Merge branch 'master' into smi/quick-start/cloudflare-remix
inventarSarah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/platforms/javascript/guides/cloudflare/frameworks/nuxt.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 5 additions & 40 deletions
45
docs/platforms/javascript/guides/cloudflare/frameworks/remix.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
/> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.