Skip to main content

Install

Basic usage

Verification only (no spend)

Omit spendAmount (or set it to new BN(0)) to verify the Sigil without recording any spend. Useful for reading endpoints or when you handle billing separately.

Applying to multiple routes

TypeScript: accessing sigilAgent

The middleware attaches the verified agent pubkey to req.sigilAgent. Extend the Request type to avoid casting:
Then in your handlers:

Error responses

The middleware returns 402 Payment Required on any failure. Common rejection reasons: