TypeScript SDK
Installation
@bkey/node:
Biometric approval in one line
This is the whole pattern — drop it anywhere you need a human in the loop.bkey.approve(...) call initiates CIBA, sends the push notification, and polls for the signed token. You never deal with the two-step protocol directly.
Verify the token before trusting it
The booleanapproved tells you the flow completed. verifyToken() tells you the token is real:
verifyToken is load-bearing and what it checks.
Anywhere a scope fits
Register a tight scope per sensitive action — it shows up on the user’s phone and prevents a token issued for one action from being replayed against another.
Structured action details
For anything the user should see in detail — amounts, recipients, resources — passactionDetails:
Checkout
For e-commerce checkouts, usecreateCheckoutRequest — it wraps CIBA with checkout-specific fields:
Vault
Request access to a stored secret (triggers biometric approval):x402 payments
See the x402 guide for the fullauthorizeX402Payment flow.
Examples
examples/typescript/agent-checkout— end-to-end checkout flowexamples/typescript/vault-access— vault secret retrieval with biometric approvalexamples/typescript/mcp-server— MCP tool gated on biometric approvalexamples/typescript/x402-agent— autonomous agent paying for x402 APIs