Skip to main content

TypeScript SDK

Installation

For server-side token verification you also want @bkey/node:

Biometric approval in one line

This is the whole pattern — drop it anywhere you need a human in the loop.
A single 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 boolean approved tells you the flow completed. verifyToken() tells you the token is real:
See MCP integration for why 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 — pass actionDetails:

Checkout

For e-commerce checkouts, use createCheckoutRequest — it wraps CIBA with checkout-specific fields:

Vault

Request access to a stored secret (triggers biometric approval):
See the encryption guide for the exact ciphertext flow.

x402 payments

See the x402 guide for the full authorizeX402Payment flow.

Examples

API Reference

Full TypeDoc reference: SDK API Docs

Source

github.com/bkeyID/bkey/typescript/packages/sdk