Skip to main content

Quickstart

1. Get Credentials

Sign up at bkey.id and create an OAuth client from the developer dashboard. You’ll receive:
  • BKEY_CLIENT_ID — your application’s client ID
  • BKEY_CLIENT_SECRET — your application’s client secret

2. Install the SDK

npm install @bkey/sdk

3. Authenticate

import { BKeyClient } from '@bkey/sdk';

const bkey = new BKeyClient({
  clientId: process.env.BKEY_CLIENT_ID!,
  clientSecret: process.env.BKEY_CLIENT_SECRET!,
});

4. Request Biometric Approval (CIBA)

CIBA is BKey’s core primitive. Your agent requests approval, the user gets a push notification on their phone, and approves with facial biometrics.
// Request biometric approval for any action
const result = await bkey.approve('Deploy to production', {
  scope: 'approve:action',
  userDid: 'did:bkey:...',
});

if (result.approved) {
  console.log('User approved! Proceeding...');
  // result.accessToken is a short-lived EdDSA JWT proving consent
}

5. Use Cases Built on CIBA

Once you have biometric approval, you can build on top of it: Checkout — Agent-initiated purchases:
bkey checkout request --merchant "Store" --amount 9.99 --currency USD
Vault — Access encrypted secrets with biometric gate:
bkey vault store --key API_KEY --value sk-...
bkey vault access --id vault_item_123
Custom actions — Use the CIBA token as proof of consent in your own app:
if (result.approved) {
  // The accessToken proves the user said yes
  await myApp.deleteResource(resourceId);
}

Next Steps