
Security News
Socket Releases Free Certified Patches for Critical vm2 Sandbox Escape
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.
@hono/sentry
Advanced tools
This middleware integrates Hono with Sentry. It captures exceptions and sends them to the specified Sentry data source name (DSN) using toucan-js.
npm i hono @hono/sentry
If you're running your application on Cloudflare Workers, set a binding value named SENTRY_DSN, which will be used as the DSN. For instance, during development, you can specify this in .dev.vars:
SENTRY_DSN=<Your DSN>
On other platforms, you can directly provide the DSN by passing it as an option:
sentry({
dsn: `<Your DSN>`,
})
import { Hono } from 'hono'
import { sentry } from '@hono/sentry'
const app = new Hono()
app.use('*', sentry())
app.get('/', (c) => c.text('foo'))
export default app
Options:
import type { Options as ToucanOptions } from 'toucan-js'
type Options = Omit<ToucanOptions, 'request' | 'context'>
import { serve } from 'https://deno.land/std/http/server.ts'
import { sentry } from 'npm:@hono/sentry'
import { Hono } from 'https://deno.land/x/hono/mod.ts'
const app = new Hono()
app.use('*', sentry({ dsn: 'https://xxxxxx@xxx.ingest.sentry.io/xxxxxx' }))
app.get('/', (c) => c.text('foo'))
serve(app.fetch)
SentryYou can retrieve an instance of Sentry using c.get('sentry').
app.onError((e, c) => {
c.get('sentry').setContext('character', {
name: 'Mighty Fighter',
age: 19,
attack_type: 'melee',
})
c.get('sentry').captureException(e)
return c.text('Internal Server Error', 500)
})
MIT
FAQs
Sentry Middleware for Hono
The npm package @hono/sentry receives a total of 46,737 weekly downloads. As such, @hono/sentry popularity was classified as popular.
We found that @hono/sentry demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A critical vm2 sandbox escape can allow untrusted JavaScript to break isolation and execute commands on the host Node.js process.

Research
Five malicious NuGet packages impersonate Chinese .NET libraries to deploy a stealer targeting browser credentials, crypto wallets, SSH keys, and local files.

Security News
pnpm 11 turns on a 1-day Minimum Release Age and blocks exotic subdeps by default, adding safeguards against fast-moving supply chain attacks.