Skip to content

withAuditContext

function withAuditContext<S>(fetch, options?): BunFetch<S>;

Defined in: src/adapters/bun.ts:54

Wrap a Bun.serve fetch handler so each request runs inside an audit context scope (ADR 0013): actor / tenant / context resolve from the request, and IP / user agent / request id are captured (the socket IP via server.requestIP is the fallback when no trusted proxy header is set).

Type Parameter
S extends BunServerLike
Parameter Type
fetch BunFetch<S>
options? AuditContextOptions<Request>

BunFetch<S>