Quickstart
Send your first reward to a verified Fomo identity: create a key, install the SDK, fund a vault, pay a handle, and get told when it's confirmed.
Create an API key
In the dashboard open API → Keys and create a key with the scopes you need (
rewards:createandpayments:readfor this guide). The raw key is shown once; FomoPay only stores a hash. This deployment issuesfp_live_…keys: they work againsthttps://fomopay.family/v1and move real USDG on Robinhood Chain mainnet.TypeScriptInstall the SDK
TerminalZero dependencies, ESM, typed. Runs on Node 18+, Bun, Deno and edge runtimes. Server-side only — the SDK refuses to run in a browser because API keys are secrets.
Fund a Reward Vault
Rewards are paid from a Reward Vault: a wallet you control (ideally a dedicated wallet or Safe) holding USDG, which approves FomoPay's payout signer for a capped allowance. Create one in Dashboard → Vaults; the funds never leave your wallet until a payout, and
approve(signer, 0)revokes access any time.Pay a handle
reward.ts201 Created (abridged)Run it twice: the second call returns the same payment with
idempotent_replayed: trueand HTTP 200 — nothing is paid twice. Change the amount but keep the key and you get409 DUPLICATE_PAYMENT. See Idempotency.Know when it's paid
wait.tsCONFIRMEDmeans the transfer is on Robinhood Chain with enough confirmations and FomoPay verified it matches the payment (sender, recipient, amount, reference). Register a webhook to receivepayment.confirmed:payment.confirmedroute.ts
Optional: preview a recipient
You don't need to resolve before paying — FomoPay resolves server-side on every payment. Use resolve to show a recipient in your own UI (it never returns an address).
Test safely on mainnet
There is no test network on this deployment. Keys are fp_live_…, the API is https://fomopay.family/v1 (the SDK's default), and every handle is a live Fomo account — so every payment is a real, irreversible transfer to a real person. Start small:
- Cap the blast radius. Approve your first vault for a small allowance and set low per-payout and daily limits. The USDG contract enforces the allowance, so a bug can never spend more than you approved — and
approve(signer, 0)revokes it. - Pay someone you know. Send a small amount to a handle you control (yours or a teammate's) and check the receipt before paying anyone else.
- Check who it is. Resolve the handle and look at the display name and avatar before your code pays it — that's what catches a typo or a lookalike.