Skip to content

IdParamOptions

IdParamOptions = object

Defined in: src/adapters/express.ts:36

Options for idParam and idQuery. All fields are optional.

Default validation is structuralsafeParse checks prefix and base32 form but does not verify any cryptographic tag. For IDs using a codec that satisfies IdVerifiableCodec (the Signed Timestamp codec or Wrapped key codec), set verify: true to also authenticate the tag.

optional onError?: (failure, req, res, next) => void

Defined in: src/adapters/express.ts:45

Called when ID validation fails. If the hook sends a response (i.e. res.headersSent is true after the hook returns), the adapter takes no further action. If the hook returns without sending a response — including if it calls next() instead of next(err) — the adapter falls back to its default error behavior and calls next(new IdParamError(...)), ensuring the route handler never runs with an invalid or missing ID.

IdParamFailure

Request

Response

NextFunction

void


optional status?: object

Defined in: src/adapters/express.ts:50

Remap the default HTTP status for a failure reason without a full handler. e.g. { brand_mismatch: 400 } treats both failure kinds as 400.

optional brand_mismatch?: number

optional malformed?: number