Skip to main content

TypeScript Quickstart

Build a private payment flow in your web app with the TypeScript SDK.
This quickstart gets you running in 5 minutes with minimal explanation. For detailed walkthroughs of each step, see the TypeScript Getting Started guide. For background on configuration and auth options, see Setup.

Installation

Quick Example

Call signIn() on every page load, not just the first. A returning user’s saved session makes it sign nothing, but the call is also what hands the SDK the wallet it will later unlock with. Skip it and the first send fails with “Wallet not available” on a session that otherwise looks fine.
Do I have to handle setupRequired? Only if you want to own the “write down your phrase” screen. Configure a prompts.recoveryPhrase handler instead and signIn() shows the phrase through it and creates the account in the same call, so the outcome is always signedIn. In a browser on the default iframe key vault the outcome is always signedIn regardless: with no handler the vault draws the phrase on its own screen rather than post the words into your page. Keep the branch anyway — it costs three lines and it is the real path in Node and in local mode. See Authentication.
For send() and unshield(), the returned txHash is a client-side placeholder until the canonical on-chain hash is available — poll by requestId (sdk.transactions.getTransferStatus / getUnshieldStatus). For shield(), txHash is the real on-chain hash because the wallet signs and submits it directly.

Progress Tracking

Track operation progress with callbacks:

Next Steps

TypeScript Getting Started

Detailed walkthrough of each integration step

Setup Guide

App ID, configuration, and auth method selection

Deposits Guide

Deposits, withdrawals, transfers, and balance queries

API Reference

Complete method signatures and type definitions