Integrations

TypeScript SDK

Use the official @affonso/sdk TypeScript client to call the Affonso API with typed resources, pagination, and errors.

Built by
Affonso
Website
affonso.io
Category
Developer Tools
Install

About TypeScript SDK

The official Affonso TypeScript SDK wraps the REST API in a typed client for Node.js and other runtimes with native fetch. It provides methods for affiliates, referrals, commissions, coupons, payouts, program settings, and embed tokens, so application code can use named resources instead of hand-written HTTP requests. The SDK supports offset and cursor pagination where those resources use it, including automatic iteration across pages.

Use with Affonso

Add @affonso/sdk to a TypeScript backend to create an affiliate after onboarding, list referrals in an admin view, or issue an embed token for a partner dashboard. Typed error classes help your code distinguish validation problems, missing records, and rate limits. The client also supports configurable timeouts and retries for rate limits and server errors.

What the TypeScript SDK gives you

  • Typed resources: Call affiliate, referral, commission, payout, and program methods from one client.
  • Pagination helpers: Read offset or cursor-based pages and iterate through larger result sets.
  • Error handling: Handle typed API errors and configure timeouts and retries for your application.