Skip to main content

TypeScript / Node.js SDK

The @yativo/crypto-sdk package is the official TypeScript SDK for the Yativo Crypto API. It ships with full TypeScript typings, automatic token refresh, rate-limit handling, and an embeddable card widget. npm version npm weekly downloads

Installation

Package: @yativo/crypto-sdk · Latest: 1.0.3 · Requirements: Node.js 16+ or a modern browser bundler (Webpack, Vite, esbuild).

Quick Start


Constructor Options


Authentication (sdk.auth)

Register

Login (Passwordless)

Login is passwordless. Call login(email) to send an OTP to the user, then call verifyOTP(otp, email) to complete authentication. The SDK stores the token internally and auto-refreshes on 401.

2FA Setup (Google Authenticator)

Passkey (WebAuthn) Auth

Exchange API Key for Bearer Token


Accounts (sdk.accounts)


Assets / Wallets (sdk.assets)

Create a Wallet

Batch Create Wallets

List Wallets

Check Balance


Transactions (sdk.transactions)

Send Funds (with Idempotency)

Estimate Gas Fee

List Transactions

Get a Transaction


Swap (sdk.swap)


Cards (sdk.cards)

Onboard a Cardholder

Create a Virtual Card

Get Card Funding Address

Get Card Transactions


Webhooks (sdk.webhooks)

Create a Webhook

Verify a Webhook Signature

Use this in your webhook receiver to confirm the payload came from Yativo:

List / Delete Webhooks


API Keys (sdk.apiKeys)


Auto-Forwarding (sdk.autoForwarding)

Auto-forwarding rules automatically sweep incoming deposits to a destination address.

Customers (sdk.customers)


Analytics (sdk.analytics)


IBAN (sdk.standaloneIban)

You must set standaloneIbanEnabled: true in the constructor to use this resource. Attempting to call these methods without the feature flag will throw a FeatureNotEnabledError.

Card Widget — YativoCardEmbed

The card widget displays sensitive card details (PAN, CVV, expiry) inside a secure sandboxed iframe. Card data never touches your JavaScript. Card data is displayed via a Yativo-hosted secure page — your backend requests a URL, your frontend opens it. No SDK widget to mount, no sensitive token to handle client-side. Step 1 — Request a secure view URL on your server:
Step 2 — Open the URL for the cardholder:
Always request a fresh URL immediately before showing it. Never cache or reuse a previous secure_view_url. See Get Secure Card View URL.

Error Handling


Rate Limiting

The Yativo Crypto API allows 60 requests per minute per endpoint. The SDK:
  1. Throws RateLimitError when a 429 response is received.
  2. Exposes err.retryAfter (seconds) so you can implement exponential back-off.

TypeScript Interfaces

Key types exported from the SDK: