From zero to protected agent payments in three steps.
Add xBPP to your project with a single command.
npm install @vanar/xbppxBPP wraps your x402 client to enforce policies.
import { evaluate, balanced } from '@vanar/xbpp';
const verdict = await evaluate(
{ amount: 50, currency: 'USDC', recipient: 'api.openai.com' },
balanced
);Every payment is now evaluated against your policy.
// All payments now go through xBPP
const response = await client.fetch(url);
// Blocked payments throw with reason codes
try {
await client.fetch(expensiveUrl);
} catch (error) {
if (error.code === 'EXCEEDS_SINGLE_LIMIT') {
console.log('Payment exceeds $100 limit');
}
}0 of 3 steps completed