Skip to main content
Contro provides official SDKs generated from our OpenAPI specification. They include full TypeScript/Python types, automatic pagination, retries, and error handling.

Installation

npm install @contro/partner-sdk

Initialize the client

import Contro from "@contro/partner-sdk";

const contro = new Contro({
  apiKey: "sk_test_your_key_here",
});
Store your API key in an environment variable (CONTRO_API_KEY) rather than hardcoding it. Both SDKs read from this variable automatically when no key is passed.

Sandbox vs production

Both environments use the same SDK — the API key prefix determines the environment:
Key prefixEnvironment
sk_test_*Sandbox
sk_live_*Production
No base URL changes needed. The SDK routes to the correct environment based on your key.

Quick example

import Contro from "@contro/partner-sdk";

const contro = new Contro({ apiKey: process.env.CONTRO_API_KEY });

// Create a cardholder
const cardholder = await contro.cardholders.create({
  externalUserId: "user_123",
  kycSource: "web_link",
  email: "jane@example.com",
  phoneNumber: "+14155552671",
});

// Issue a card
const card = await contro.cards.create({
  cardholderId: cardholder.id,
  programId: "cp_xyz789",
});

// List transactions with automatic pagination
const transactions = await contro.cards.listTransactions(card.id);
for (const tx of transactions.data) {
  console.log(`${tx.type} ${tx.amount} ${tx.currency}`);
}

SDK references

Node.js SDK

Full API reference, changelog, and source code

Python SDK

Full API reference, changelog, and source code

Next steps

Quickstart

Issue your first card in 5 steps

API reference

Explore all endpoints