Bridge.xyz API Skills Index
Skills Overview
| Skill | Description | Use Case |
|---|---|---|
| bridge-core | Core client setup, error handling, validation | Initial setup and common utilities |
| bridge-customers | Customer onboarding, KYC, management | User registration and verification |
| bridge-wallets | Custodial wallets, multi-chain support | Treasury and fund management |
| bridge-virtual-accounts | Virtual USD/EUR/MXN accounts | Receiving fiat deposits |
| bridge-transfers | Money movement, on/off ramps | Payment processing |
| bridge-cards | Visa card provisioning | Crypto spending |
| bridge-external-accounts | Bank account linking | Offramping to bank accounts |
| bridge-stablecoins | USDB management, rewards | Stablecoin operations |
| bridge-fees | Developer fee configuration | Monetization |
| bridge-webhooks | Event handling, signature verification | Real-time updates |
| bridge-crypto-return-policies | Return policy management | Failed transfer handling |
Quick Start Path
Path 1: Payments Platform
code
bridge-core → bridge-customers → bridge-wallets → bridge-transfers → bridge-fees
Path 2: Banking Integration
code
bridge-core → bridge-customers → bridge-external-accounts → bridge-transfers
Path 3: Card Issuing
code
bridge-core → bridge-customers → bridge-wallets → bridge-cards → bridge-webhooks
Feature Comparison
| Feature | Customer | Wallet | Virtual Account | Transfer | Card |
|---|---|---|---|---|---|
| Create customers | ✅ | ||||
| Create wallets | ✅ | ||||
| Manage funds | ✅ | ✅ | ✅ | ||
| Receive fiat | ✅ | ||||
| Send crypto | ✅ | ||||
| Link banks | |||||
| Issue cards | ✅ | ||||
| Configure fees | ✅ | ✅ |
Common Integration Patterns
Pattern 1: Complete Onramp
code
1. bridge-customers.createKycLink() 2. bridge-wallets.create() 3. bridge-virtual-accounts.create() [optional] 4. bridge-transfers.create() 5. bridge-webhooks.handle() [listen for completion]
Pattern 2: Complete Offramp
code
1. bridge-customers.createKycLink() 2. bridge-external-accounts.create() 3. bridge-transfers.create() 4. bridge-webhooks.handle() [listen for completion]
Pattern 3: Card Spending
code
1. bridge-customers.createKycLink() 2. bridge-wallets.create() 3. bridge-cards.provision() 4. bridge-transfers.fundCard() 5. bridge-webhooks.handle() [transactions]
Pattern 4: Treasury Management
code
1. bridge-customers.createKycLink() [business] 2. bridge-wallets.create() [multiple chains] 3. bridge-wallets.tagWallet() 4. bridge-transfers.walletToWallet() 5. bridge-fees.updateDefault()
Code Examples
Basic Setup
typescript
import { Bridge } from './bridge-core';
// Initialize client
export const bridge = new Bridge({
apiKey: process.env.BRIDGE_API_KEY!,
});
Customer Onboarding
typescript
// From bridge-customers
const kycLink = await bridge.customers.createKycLink({
full_name: 'John Doe',
email: 'john@example.com',
type: 'individual',
});
console.log('KYC Link:', kycLink.kyc_link);
Create Wallet
typescript
// From bridge-wallets
const wallet = await bridge.wallets.create(customerId, 'solana');
console.log('Wallet:', wallet.address);
Transfer Funds
typescript
// From bridge-transfers
const transfer = await bridge.transfers.create({
amount: '100',
on_behalf_of: customerId,
source: { payment_rail: 'ach_push', currency: 'usd' },
destination: { payment_rail: 'solana', currency: 'usdc', to_address: wallet.address },
});
Handle Webhooks
typescript
// From bridge-webhooks
app.post('/webhooks/bridge', express.raw({ type: 'application/json' }), (req, res) => {
const payload = req.body;
const signature = req.headers['x-webhook-signature'];
const isValid = verifyWebhookSignature(payload, signature);
if (isValid) {
handleWebhookEvent(JSON.parse(payload.toString()));
}
res.status(200).json({ received: true });
});
Error Handling
typescript
// From bridge-core
try {
const result = await bridge.transfers.create(request);
} catch (error) {
if (error instanceof BridgeApiError) {
switch (error.code) {
case 'required':
console.error('Missing required field');
case 'invalid':
console.error('Invalid value');
}
}
}
Environment Setup
bash
# Required environment variables BRIDGE_API_KEY=your_api_key_here BRIDGE_WEBHOOK_SECRET=your_webhook_public_key # Optional BRIDGE_BASE_URL=https://api.bridge.xyz/v0 BRIDGE_TIMEOUT=30000
Testing Checklist
- • Initialize Bridge client
- • Create test customer with KYC
- • Create test wallet
- • Create virtual account
- • Execute test transfer (sandbox)
- • Set up webhook endpoint
- • Verify webhook signature
- • Handle transfer completed event
- • Configure developer fees
- • Test error scenarios
Resources
Skill Dependencies
code
bridge-core ├── bridge-customers ├── bridge-wallets ├── bridge-virtual-accounts ├── bridge-transfers ├── bridge-cards ├── bridge-external-accounts ├── bridge-stablecoins ├── bridge-fees ├── bridge-webhooks └── bridge-crypto-return-policies
Best Practices
- •Start with bridge-core - Always initialize properly
- •Use TypeScript - Full type safety available
- •Handle errors gracefully - Use BridgeApiError
- •Use idempotency keys - Prevent duplicates
- •Implement webhooks - Better than polling
- •Validate inputs - Use validation utilities
- •Rate limit requests - Implement rate limiting
- •Test in sandbox - Before production
- •Monitor webhooks - Track all events
- •Keep API keys secure - Never commit to code