BRIDGE Intelligence
BRIDGEIntelligence
Build/Integrations/SDKs & Client Libraries

SDKs & Client Libraries

Official Bridge SDKs for TypeScript, Python, and Kotlin.

Available SDKs

| Language | Package | Repository | |----------|---------|-----------| | TypeScript / JavaScript | @bridge/sdk | github.com/bridge-intelligence/sdk-typescript | | Python | bridge-sdk | github.com/bridge-intelligence/sdk-python | | Kotlin / Java | digital.binari:bridge-sdk | github.com/bridge-intelligence/sdk-kotlin |

TypeScript / JavaScript

Installation

npm install @bridge/sdk # or pnpm add @bridge/sdk # or yarn add @bridge/sdk

Initialization

import { Bridge } from '@bridge/sdk' const bridge = new Bridge({ apiKey: process.env.BRIDGE_API_KEY, environment: 'production', // or 'sandbox' })

Example: Create a Wallet

const wallet = await bridge.wallets.create({ label: 'Customer Wallet #1', currency: 'USD', }) console.log(wallet.id) // wal_abc123

Example: Initiate a Cross-Border Payment

const payment = await bridge.payments.create({ source: wallet.id, destination: 'wal_xyz789', amount: 50_000, currency: 'USD', corridor: 'US-PK', settlement: 'instant', }) // payment.status: 'pending' → 'settled' (within 3 seconds)

Example: Subscribe to Webhooks

bridge.webhooks.on('payment.settled', async (event) => { console.log('Payment settled:', event.data.object.id) // Update your database, notify your customer, etc. })

Python

Installation

pip install bridge-sdk

Initialization

from bridge import Bridge bridge = Bridge( api_key=os.environ['BRIDGE_API_KEY'], environment='production' )

Example: Verify Identity with Bridge ID

verification = bridge.identity.verify( user_id='usr_abc123', documents=[ {'type': 'national_id', 'file': open('id.jpg', 'rb')}, {'type': 'selfie', 'file': open('selfie.jpg', 'rb')} ] ) if verification.risk_score < 60: print('Auto-approved') elif verification.risk_score < 80: print('Manual review required') else: print('Auto-denied')

Example: Custody Operations

# Create an HD wallet wallet = bridge.custody.wallets.create( chain='ethereum', label='Treasury Wallet' ) # Get a fresh deposit address address = bridge.custody.wallets.get_address(wallet.id) # Initiate a withdrawal (requires multi-sig approval) withdrawal = bridge.custody.withdrawals.create( wallet_id=wallet.id, to_address='0x...', amount=Decimal('1.5'), asset='ETH' )

Kotlin

Installation (Gradle)

dependencies { implementation("digital.binari:bridge-sdk:1.0.0") }

Initialization

import digital.binari.bridge.Bridge val bridge = Bridge( apiKey = System.getenv("BRIDGE_API_KEY"), environment = Environment.PRODUCTION )

Example: Settlement Flow

val payment = bridge.payments.create( PaymentRequest( source = "wal_abc123", destination = "wal_xyz789", amount = BigDecimal("50000"), currency = "USD", corridor = "US-PK", settlement = SettlementType.INSTANT ) ) println("Payment ${payment.id} status: ${payment.status}")

Error Handling

All SDKs follow consistent error patterns:

TypeScript

try { const payment = await bridge.payments.create({ ... }) } catch (err) { if (err instanceof BridgeError) { console.error(err.code) // 'INSUFFICIENT_FUNDS' console.error(err.message) // 'Source wallet has insufficient balance' console.error(err.requestId) // 'req_abc123' } }

Python

from bridge.errors import BridgeError, InsufficientFundsError try: payment = bridge.payments.create(...) except InsufficientFundsError as e: print(f'Not enough funds: {e.message}') except BridgeError as e: print(f'API error: {e.code} - {e.message}')

Retries & Timeouts

All SDKs include automatic retry with exponential backoff for transient errors. Customize via configuration:

const bridge = new Bridge({ apiKey: process.env.BRIDGE_API_KEY, maxRetries: 3, // default: 3 timeout: 30_000, // default: 30s retryOn: [429, 500, 502] // default })

TypeScript Types

The TypeScript SDK ships with full type definitions:

import type { Payment, Wallet, KycVerification } from '@bridge/sdk' function processPayment(payment: Payment) { // Full autocomplete and type checking }
Last updated: April 10, 2026