CreateCallbackHandlerOptions
Defined in: src/callbacks/receiver.ts:36
Properties
Section titled “Properties”onNotFound()?
Section titled “onNotFound()?”
optionalonNotFound: (req,res) =>void
Defined in: src/callbacks/receiver.ts:46
Called when no route matches (default: 404).
Parameters
Section titled “Parameters”IncomingMessage
ServerResponse
Returns
Section titled “Returns”void
onParseError()?
Section titled “onParseError()?”
optionalonParseError: (err,req,res) =>void
Defined in: src/callbacks/receiver.ts:44
Called when body parse fails; can send custom response (default: 400 + error message).
Parameters
Section titled “Parameters”IncomingMessage
ServerResponse
Returns
Section titled “Returns”void
routes
Section titled “routes”routes:
Record<string,CallbackRoute<unknown>>
Defined in: src/callbacks/receiver.ts:38
Path -> route. Path should match req.url pathname (e.g. “/mpesa/stk”).
successBody?
Section titled “successBody?”
optionalsuccessBody:string|Record<string,unknown>
Defined in: src/callbacks/receiver.ts:42
Body sent on success (default “OK”). Can be string or object (sent as JSON).
successStatus?
Section titled “successStatus?”
optionalsuccessStatus:number
Defined in: src/callbacks/receiver.ts:40
Status code for successful handling (default 200).