Skip to content
Open
Changes from 1 commit
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
@@ -1,7 +1,6 @@
Wrap your worker handler with the `withSentry` function, for example, in your `index.ts` file, to initialize the Sentry SDK and hook into the environment:

```typescript {filename:index.ts}
import { Hono, HTTPException } from "hono";
import * as Sentry from "@sentry/cloudflare";

export default Sentry.withSentry(
Expand Down Expand Up @@ -30,7 +29,11 @@ export default Sentry.withSentry(
// ___PRODUCT_OPTION_END___ performance
};
},
// your existing worker export
app
{
async fetch(request, env, ctx) {
// Your worker logic here
return new Response("Hello World!");
},
}
Comment on lines +32 to +37
Copy link
Member

@s1gr1d s1gr1d Nov 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is now also used on this page: https://sentry-docs-git-fix-cloudflare-setup-snippet.sentry.dev/platforms/javascript/guides/cloudflare/frameworks/hono/

We should use a Hono-specific snippet on the Hono setup and we need the following imports and the app:

import { Env, Hono } from "hono";

const app = new Hono();

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I'll double check where else that includes exists, but doesn't seem like it should be used on any of the other framework specific docs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@s1gr1d - updated. Let me know how it looks.

);
```
Loading