Skip to content

getGatewayContext

getGatewayContext(c): PolicyContext | undefined

Defined in: src/core/pipeline.ts:189

Retrieve the PolicyContext from a Hono context.

Returns undefined if called outside the gateway pipeline (e.g. in a standalone Hono app without context injection).

Context

The Hono request context.

PolicyContext | undefined

The gateway context, or undefined if not in a gateway pipeline.