Skip to main content

SDK Reference

Tavio offers official SDKs in JavaScript/TypeScript, Python, and Go. All SDKs wrap the REST API and provide typed interfaces, error handling, and convenient builder patterns.

Installation

npm install @tavio/sdk

Initialization & Usage

Create a Payment

import Tavio from "@tavio/sdk";

const tavio = new Tavio({ apiKey: "tv_live_xxxxxxxxxxxx" });

const payment = await tavio.payments.create({
amount: 5000,
currency: "USD",
settlementAsset: "USDC",
paymentMethods: ['card', 'crypto'],
customer: { email: 'user@example.com' }
});

console.log(payment.checkoutUrl);

Create a Payout

const payout = await tavio.payouts.create({
  amount: 200,
  currency: "USD",
  recipient: {
    name: "John Doe",
    destination: { type: "bank_account", routing: "021000021", account: "9876543210" }
  }
});