OwlVerifier
Server-side client for verifying OwlID tokens. Imported from @owlid/sdk.
Constructor
Methods
verify(token, challenge)
Confirm a token against a challenge. The platform checks the issuer signature, Merkle proofs, ZK predicate proofs, expiry, and revocation in a single round trip.
challenge must match what the holder bound into the token. If you minted it via mintChallenge(), the platform consumes it atomically — replays fail.
mintChallenge()
Mint a single-use server-managed challenge. The platform stores it and consumes it on the matching verify() call.
If you don't need platform-managed replay protection, you can also pass your own random string straight to verify().
requestPresentation(options) — one-call QR flow
Single call that opens a session, renders the QR (via your callback), waits for the holder to push a token, and returns the verification result. Wraps the WebSocket lifecycle for you.
Browser-only (uses the global WebSocket). For server flows use openPresentation() plus your own WS client.
openPresentation() — manual control
If you need to manage the WebSocket yourself:
The session nonce becomes the challenge for the eventual verify() call.
subscribeRevocations(handler)
Browser-only. Subscribes to live revocation events so you can invalidate cached verification results.
In Node, call verifier.revocationFeedUrl() and connect with node:ws directly.
revocationFeedUrl()
Returns the WebSocket URL for the live revocation feed. Useful if you want to manage the connection yourself (Node, custom retry logic, etc.).
listIssuers()
List trusted issuers visible to your account.
Types
Errors
All methods throw on transport / auth failures. verify() itself returns { valid: false, error } for cryptographic failures (untrusted issuer, expired, revoked, challenge mismatch) — these are a normal part of the flow, not exceptions.