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 thread
sentry[bot] marked this conversation as resolved.
Comment thread
s1gr1d marked this conversation as resolved.

</SplitSectionCode>
</SplitSection>
</SplitLayout>
Comment on lines 85 to 94

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 Deno installation guide is missing the instruction to install the main @sentry/hono package, which will cause an import error when following the code example.
Severity: MEDIUM

Suggested Fix

Add a "Deno" tab to the first installation step's code block. This tab should contain the command deno add npm:@sentry/hono to ensure users install the main package before proceeding.

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#L85-L94

Potential issue: The documentation for setting up Sentry with the Hono framework for the
Deno runtime is incomplete. The first installation step, which instructs users to
install the main `@sentry/hono` package, is missing a tab with the command for Deno
users. The second step correctly shows how to install the `@sentry/deno` peer
dependency. However, the code example provided later in the guide relies on an import
from `@sentry/hono/deno`, which will fail if the main `@sentry/hono` package is not
installed. This creates a broken onboarding experience for Deno users, as following the
documented steps will lead to an import error.

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 and HTTP bodies, uncomment the line below. For more info visit:
// https://docs.sentry.io/platforms/javascript/guides/hono/configuration/options/#dataCollection
// dataCollection: { userInfo: false, httpBodies: [] },
// ___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