honojs-middleware/packages/sentry
Markkus Millend 963b1ac0de
Sentry middleware: fix undefined DSN environment variable error (#89)
* Use optional chaining for determining Sentry DSN from environment

* Bump Hono version for Sentry middleware

* Fix tests on Deno

* Add changeset for Sentry middleware patch

* Denoify the new Sentry patch
2023-06-02 06:31:51 +09:00
..
deno_dist Sentry middleware: fix undefined DSN environment variable error (#89) 2023-06-02 06:31:51 +09:00
deno_test Sentry middleware: fix undefined DSN environment variable error (#89) 2023-06-02 06:31:51 +09:00
src Sentry middleware: fix undefined DSN environment variable error (#89) 2023-06-02 06:31:51 +09:00
test Add 'packages/sentry/' from commit '6cb773ae9b303ce4def1b801cac9fa91be5ea747' 2023-02-04 16:12:03 +09:00
CHANGELOG.md Version Packages (#58) 2023-03-02 15:15:36 +09:00
README.md setup Sentry middleware 2023-02-04 16:19:47 +09:00
jest.config.js setup Sentry middleware 2023-02-04 16:19:47 +09:00
package.json Sentry middleware: fix undefined DSN environment variable error (#89) 2023-06-02 06:31:51 +09:00
tsconfig.json setup Sentry middleware 2023-02-04 16:19:47 +09:00

README.md

Sentry middleware for Hono

Sentry middleware for Hono. This middleware sends captured exceptions to the specified Sentry data source name via toucan-js.

Usage

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

Deno

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)

Author

Samuel Lippert https://github.com/sam-lippert

License

MIT