Quickstart
Send your first reward to a verified Fomo identity: create a key, install the SDK, fund a vault, pay @lyra, 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.fp_test_…keys work against the local development chain,fp_live_…keys against 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 @lyra
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).
Run it against the local stack
The FomoPay repo runs the whole platform locally — API, worker and a local anvil chain (id 31337) with a 6-decimal USDG at the real USDG address — so every example here works end to end with real transactions and no real money.
Locally (and until the live Fomo identity integration is authorized) @lyra, @mia, @frog and @builder are sandbox identities. They are labelled “Sandbox” everywhere and carry a SANDBOX_IDENTITY warning.