Skip to content
Merged
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
1 change: 1 addition & 0 deletions docs/platforms/javascript/common/install/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ notSupported:
- javascript.ember
- javascript.firebase
- javascript.gatsby
- javascript.hono
- javascript.nextjs
- javascript.nuxt
- javascript.react
Expand Down
132 changes: 3 additions & 129 deletions docs/platforms/javascript/guides/cloudflare/frameworks/hono.mdx
Original file line number Diff line number Diff line change
@@ -1,134 +1,8 @@
---
title: Hono on Cloudflare
description: "Learn how to instrument your Hono app on Cloudflare Workers and capture your first errors with Sentry."
description: "Learn how to instrument your Hono app on Cloudflare Workers with Sentry."
---

<PlatformContent includePath="getting-started-primer" />
Hono has its own dedicated SDK (`@sentry/hono`) with first-class support for Cloudflare Workers, Node.js, and Bun.

<Alert type="warning" title="Community Middleware Deprecation">
The community-maintained `@hono/sentry` middleware that uses `toucan-js` has
been deprecated in favor of using `@sentry/cloudflare` directly. If you're
currently using the `@hono/sentry` middleware with `toucan-js`, you should
migrate to `@sentry/cloudflare` directly as shown in this guide.
</Alert>

<StepConnector selector="h2" showNumbers={true}>

## Install

Choose the features you want to configure, and this guide will show you how:

<OnboardingOptionButtons
options={["error-monitoring", "performance", "logs"]}
/>

<Include name="quick-start-features-expandable" />

### Install the Sentry SDK

<SplitLayout>
<SplitSection>
<SplitSectionText>

Run the command for your preferred package manager to add the Sentry SDK to your application:

</SplitSectionText>
<SplitSectionCode>

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

</SplitSectionCode>
</SplitSection>
</SplitLayout>

## Configure

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

### Wrangler Configuration

<PlatformContent
includePath="getting-started-config"
platform="javascript.cloudflare.splitlayout"
/>

### Initialize the Sentry SDK

<PlatformContent
includePath="getting-started-config"
platform="javascript.cloudflare.hono"
/>

### Migration from Community Middleware

<SplitLayout>
<SplitSection>
<SplitSectionText>

If you're currently using the `@hono/sentry` middleware, migrate to the official `@sentry/cloudflare` middleware:

</SplitSectionText>
<SplitSectionCode>

```javascript
// New approach using official Sentry SDK
import { Hono } from 'hono';
import * as Sentry from '@sentry/cloudflare';

const app = new Hono();

// Wrap your app with Sentry
export default Sentry.withSentry(
(env: Env) => ({
dsn: '___PUBLIC_DSN___',
tracesSampleRate: 1.0,
}),
app
);
```

</SplitSectionCode>
</SplitSection>
</SplitLayout>

<PlatformContent
includePath="getting-started-capture-errors"
platform="javascript.hono"
/>

### Add Readable Stack Traces With Source Maps (Optional)

<PlatformContent
includePath="getting-started-sourcemaps-short-version-splitlayout"
platform="javascript"
/>

## Verify Your Setup

<PlatformContent
includePath="getting-started-verify"
platform="javascript.hono"
/>

<Include name="quick-start-locate-data-expandable" />

## Next Steps

At this point, you should have integrated Sentry and should already be sending data to your Sentry project.

Now's a good time to customize your setup and look into more advanced topics. Our next recommended steps for you are:

- Learn how to [manually capture errors](/platforms/javascript/guides/cloudflare/usage/)
- Continue to [customize your configuration](/platforms/javascript/guides/cloudflare/configuration/)
- Make use of [Cloudflare-specific features](/platforms/javascript/guides/cloudflare/features)
- Get familiar with [Sentry's product features](/product) like tracing, insights, and alerts

<Expandable permalink={false} title="Are you having problems setting up the SDK?">

- Check out setup instructions for other popular [frameworks on Cloudflare](/platforms/javascript/guides/cloudflare/frameworks/)
- Find various support topics in <PlatformLink to="/troubleshooting">troubleshooting</PlatformLink>
- [Get support](https://sentry.zendesk.com/hc/en-us/)

</Expandable>

</StepConnector>
For setup instructions, see the **[Hono Quick Start Guide](/platforms/javascript/guides/hono/)**.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
title: Frameworks on Cloudflare
description: "Learn how to set up the Cloudflare SDK with popular Frameworks like Astro, SvelteKit, Remix, and Hono."
description: "Learn how to set up the Cloudflare SDK with popular frameworks like Astro, SvelteKit, and Remix."
---

You can use the Sentry Cloudlare SDK in combination with Sentry meta-framework SDKs like SvelteKit or Remix to instrument your Cloudflare Pages applications that use these frameworks.
You can use the Sentry Cloudflare SDK in combination with Sentry meta-framework SDKs like SvelteKit or Remix to instrument your Cloudflare Pages applications that use these frameworks.

<PageGrid />
2 changes: 1 addition & 1 deletion docs/platforms/javascript/guides/cloudflare/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ categories:
Use this guide for general instructions on using the Sentry SDK with Cloudflare. If you're using any of the listed frameworks, follow their specific setup instructions:

- **[Astro](/platforms/javascript/guides/cloudflare/frameworks/astro/)**
- **[Hono](/platforms/javascript/guides/cloudflare/frameworks/hono/)**
- **[Hono](/platforms/javascript/guides/hono/)** (with @sentry/hono)
- **[Hydrogen](/platforms/javascript/guides/cloudflare/frameworks/hydrogen-react-router/)**
- **[Next.js](/platforms/javascript/guides/cloudflare/frameworks/nextjs/)**
- **[Nuxt](/platforms/javascript/guides/cloudflare/frameworks/nuxt/)**
Expand Down
Loading
Loading