Skip to content
Open
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 @@ -3,6 +3,6 @@ title: Hono on Cloudflare
description: "Learn how to instrument your Hono app on Cloudflare Workers with Sentry."
---

Hono has its own dedicated SDK (`@sentry/hono`) with first-class support for Cloudflare Workers, Node.js, and Bun.
Hono has its own dedicated SDK (`@sentry/hono`) with first-class support for Cloudflare Workers, Node.js, Bun, and Deno.

For setup instructions, see the **[Hono Quick Start Guide](/platforms/javascript/guides/hono/)**.
38 changes: 37 additions & 1 deletion docs/platforms/javascript/guides/hono/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ categories:
- server-node
---

The `@sentry/hono` SDK supports Hono 4+ across multiple runtimes: Cloudflare Workers, Node.js, and Bun. It works as Hono middleware, so you can drop it into your existing app with minimal setup.
The `@sentry/hono` SDK supports Hono 4+ across multiple runtimes: Cloudflare Workers, Node.js, Bun, and Deno. It works as Hono middleware, so you can drop it into your existing app with minimal setup.

<Expandable title="Are you using @hono/sentry?">

Expand Down Expand Up @@ -85,6 +85,10 @@ npm install @sentry/node
npm install @sentry/bun
```

```bash {tabTitle:Deno}
deno add npm:@sentry/deno
```
Comment on lines +88 to +90

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: The Hono guide for Deno is missing the installation step for the @sentry/hono package, which will cause an import error for users following the documentation.
Severity: HIGH

Suggested Fix

In the "Install the Sentry SDK" section of the Hono guide, add a new tab for Deno with the corresponding installation command: deno add npm:@sentry/hono.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: docs/platforms/javascript/guides/hono/index.mdx#L88-L90

Potential issue: The documentation for integrating Sentry with Hono on the Deno runtime
is missing a crucial installation step. The guide instructs users to install the peer
dependency `@sentry/deno` but omits the instruction to install the main `@sentry/hono`
package. The provided code example then attempts to import from `@sentry/hono/deno`.
Since `@sentry/hono` was never installed, this will result in a module not found error,
preventing users from successfully setting up Sentry for their Hono application on Deno.

Did we get this right? 👍 / 👎 to inform future reviews.


</SplitSectionCode>
</SplitSection>
</SplitLayout>
Expand Down Expand Up @@ -319,6 +323,38 @@ app.use(
export default app;
```

```typescript {tabTitle:Deno} {filename:index.ts}
import { Hono } from "hono";
import { sentry } from "@sentry/hono/deno";

const app = new Hono();

app.use(
sentry(app, {
dsn: "___PUBLIC_DSN___",

// To disable sending user data, uncomment the line below. For more info visit:
// https://docs.sentry.io/platforms/javascript/guides/hono/configuration/options/#dataCollection
// dataCollection: { userInfo: false },
// ___PRODUCT_OPTION_START___ performance

// Set tracesSampleRate to 1.0 to capture 100%
// of spans for tracing.
tracesSampleRate: 1.0,
// ___PRODUCT_OPTION_END___ performance
// ___PRODUCT_OPTION_START___ logs

// Enable logs to be sent to Sentry
enableLogs: true,
// ___PRODUCT_OPTION_END___ logs
})
);

// Your routes here

Deno.serve(app.fetch);
```

</SplitSectionCode>
</SplitSection>
</SplitLayout>
Expand Down
Loading