Skip to content

basalt / hono/src / HonoPluginOptions

Interface: HonoPluginOptions ​

Defined in: hono/src/index.ts:438

Properties ​

allowUnguardedMeta? ​

> optional allowUnguardedMeta?: boolean | string[]

Defined in: hono/src/index.ts:449

Waives the boot-time check that every route declaring security meta (auth, can, teamRole) has a registered guard enforcing it. Pass true to waive everything (e.g. authentication handled at an outer edge/gateway), or an array of specific keys. Default: fail loud at boot. It never waives the route-meta validators plugins register (META_VALIDATORS_BUCKET, e.g. teamsPlugin refusing an unknown meta.teamRole) — those also run at boot and fail it.


app? ​

> optional app?: Hono<any, BlankSchema, "/">

Defined in: hono/src/index.ts:451

Bring your own Hono app; otherwise a fresh one is created.


bodyLimit? ​

> optional bodyLimit?: number

Defined in: hono/src/index.ts:472

Maximum request body size in bytes, enforced on the bytes actually read: a declared Content-Length above it is rejected up front, and a body without one (chunked/streamed) is counted while buffering and rejected with 413 the moment it crosses the limit. Hono/edge has no default cap, so without this a large upload is unbounded. Default: 1 MiB.


errorHandler? ​

> optional errorHandler?: boolean

Defined in: hono/src/index.ts:490

Install an app.onError that turns errors raised outside a route (a failing pre-hook or edge route, an unreadable body) into the neutral JSON envelope and reports them through onError, instead of Hono's plain-text 500. Default: true. Pass false only if you install your own onError (Hono keeps one handler; the last call wins).


getClientIp? ​

> optional getClientIp?: ClientIpResolver

Defined in: hono/src/index.ts:482

Resolves the client address exposed as request.ip — the key for per-client rate limiting (securityPlugin) and the IP login throttle. Default: the socket address on @hono/node-server and Bun; undefined elsewhere (a one-time warning is printed, and rate limits then share a single bucket). On an edge runtime or behind a trusted proxy, supply it, e.g. (c) => c.req.header('cf-connecting-ip') on Cloudflare. Never read X-Forwarded-For unless a proxy you control overwrites it.


notFound? ​

> optional notFound?: boolean

Defined in: hono/src/index.ts:464


onError? ​

> optional onError?: HttpErrorReporter

Defined in: hono/src/index.ts:463

Where failed requests are reported. Default: 5xx via console.error (with the stack) and 4xx via console.warn, prefixed [basalt:http]. Pass your own to route them into a real logger, or () => {} to silence them.


routes? ​

> optional routes?: BasaltRoute[]

Defined in: hono/src/index.ts:439

Released under the MIT License.