Skip to content

Commit 08b614d

Browse files
committed
chore(hono): Prepare readme and add craft entry
1 parent 7ef2885 commit 08b614d

2 files changed

Lines changed: 13 additions & 4 deletions

File tree

.craft.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ targets:
9494
- name: npm
9595
id: '@sentry/bun'
9696
includeNames: /^sentry-bun-\d.*\.tgz$/
97+
- name: npm
98+
id: '@sentry/hono'
99+
includeNames: /^sentry-hono-\d.*\.tgz$/
97100
- name: npm
98101
id: '@sentry/nestjs'
99102
includeNames: /^sentry-nestjs-\d.*\.tgz$/

packages/hono/README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212

1313
## Links
1414

15-
- [Official SDK Docs](https://docs.sentry.io/quickstart/)
15+
- [General SDK Docs](https://docs.sentry.io/quickstart/) - Official Docs for this Hono SDK are coming soon!
16+
17+
The current [Hono SDK Docs](https://docs.sentry.io/platforms/javascript/guides/hono/) explain using Sentry in Hono by using other Sentry SDKs (e.g. `@sentry/node` or `@sentry/cloudflare`)
1618

1719
## Install
1820

@@ -24,9 +26,9 @@ npm install @sentry/hono
2426

2527
## Setup (Cloudflare Workers)
2628

27-
### Enable Node.js compatibility
29+
### 1. Enable Node.js compatibility
2830

29-
Either set the `nodejs_compat` compatibility flags in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly.
31+
Set the `nodejs_compat` compatibility flag in your `wrangler.jsonc`/`wrangler.toml` config. This is because the SDK needs access to the `AsyncLocalStorage` API to work correctly.
3032

3133
```jsonc {tabTitle:JSON} {filename:wrangler.jsonc}
3234
{
@@ -38,7 +40,7 @@ Either set the `nodejs_compat` compatibility flags in your `wrangler.jsonc`/`wra
3840
compatibility_flags = ["nodejs_compat"]
3941
```
4042

41-
### Initialize Sentry in your Hono app
43+
### 2. Initialize Sentry in your Hono app
4244

4345
Initialize the Sentry Hono middleware as early as possible in your app:
4446

@@ -47,12 +49,16 @@ import { sentry } from '@sentry/hono/cloudflare';
4749

4850
const app = new Hono();
4951

52+
// Initialize Sentry middleware right after creating the app
5053
app.use(
5154
'*',
5255
sentry(app, {
5356
dsn: 'your-sentry-dsn',
57+
// ...other Sentry options
5458
}),
5559
);
5660

61+
// ... your routes and other middleware
62+
5763
export default app;
5864
```

0 commit comments

Comments
 (0)