Skip to content

Commit fb1b7ba

Browse files
authored
chore(hono): Prepare readme and add craft entry (#19583)
Closes #19584 (added automatically)
1 parent 5767e4a commit fb1b7ba

File tree

2 files changed

+21
-4
lines changed

2 files changed

+21
-4
lines changed

.craft.yml

Lines changed: 8 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$/
@@ -197,6 +200,11 @@ targets:
197200
onlyIfPresent: /^sentry-gatsby-\d.*\.tgz$/
198201
'npm:@sentry/google-cloud-serverless':
199202
onlyIfPresent: /^sentry-google-cloud-serverless-\d.*\.tgz$/
203+
'npm:@sentry/hono':
204+
name: 'Sentry Hono SDK'
205+
packageUrl: 'https://www.npmjs.com/package/@sentry/hono'
206+
mainDocsUrl: 'https://docs.sentry.io/platforms/javascript/guides/hono/'
207+
onlyIfPresent: /^sentry-hono-\d.*\.tgz$/
200208
'npm:@sentry/nestjs':
201209
onlyIfPresent: /^sentry-nestjs-\d.*\.tgz$/
202210
'npm:@sentry/nextjs':

packages/hono/README.md

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,14 @@
1010
[![npm dm](https://img.shields.io/npm/dm/@sentry/hono.svg)](https://www.npmjs.com/package/@sentry/hono)
1111
[![npm dt](https://img.shields.io/npm/dt/@sentry/hono.svg)](https://www.npmjs.com/package/@sentry/hono)
1212

13+
This SDK is compatible with Hono 4+ and is currently in ALPHA. Alpha features are still in progress, may have bugs and might include breaking changes.
14+
Please reach out on [GitHub](https://github.com/getsentry/sentry-javascript/issues/new/choose) if you have any feedback or concerns.
15+
1316
## Links
1417

15-
- [Official SDK Docs](https://docs.sentry.io/quickstart/)
18+
- [General SDK Docs](https://docs.sentry.io/quickstart/) - Official Docs for this Hono SDK are coming soon!
19+
20+
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`)
1621

1722
## Install
1823

@@ -24,9 +29,9 @@ npm install @sentry/hono
2429

2530
## Setup (Cloudflare Workers)
2631

27-
### Enable Node.js compatibility
32+
### 1. Enable Node.js compatibility
2833

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.
34+
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.
3035

3136
```jsonc {tabTitle:JSON} {filename:wrangler.jsonc}
3237
{
@@ -38,7 +43,7 @@ Either set the `nodejs_compat` compatibility flags in your `wrangler.jsonc`/`wra
3843
compatibility_flags = ["nodejs_compat"]
3944
```
4045

41-
### Initialize Sentry in your Hono app
46+
### 2. Initialize Sentry in your Hono app
4247

4348
Initialize the Sentry Hono middleware as early as possible in your app:
4449

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

4853
const app = new Hono();
4954

55+
// Initialize Sentry middleware right after creating the app
5056
app.use(
5157
'*',
5258
sentry(app, {
5359
dsn: 'your-sentry-dsn',
60+
// ...other Sentry options
5461
}),
5562
);
5663

64+
// ... your routes and other middleware
65+
5766
export default app;
5867
```

0 commit comments

Comments
 (0)