Building with the packages
Two packages cover most of an integration: a typed client for your server, and Fin's blocks for your React chat. Use either one alone, or both together.
@nearai/financial-agents-sdk: every operation, typed, with sessions, retries and live streams handled.React components@nearai/financial-agents-react: Fin's replies, approvals, questions and result cards, inside your own chat.How they fit
Your API key and your users' sessions stay on your server. The SDK talks to Fin, your server relays the conversation, and the React package draws it.
- Your server creates the user, opens their session after your own sign-in, and starts a run for each message:
users.create,users.createSession,runs.start. - Your server follows the conversation with
events.streamand relays each event to the page. - Your page folds the events with
threadReducer, and draws Fin's entries withFinEntrybeside your own message bubbles. - The user decides an approval or answers a question; your server sends it with
approvals.approve,approvals.denyorquestions.answer.
Neither package needs the other: use the SDK under your own interface, or the components over data your server reads by HTTP.
Install
npm install @nearai/financial-agents-sdk # on your server
npm install @nearai/financial-agents-react @base-ui/react # in your React appRequirements
@nearai/financial-agents-sdk | @nearai/financial-agents-react | |
|---|---|---|
| Runs on | Your server: Node 20+, Bun, Deno, edge runtimes | The browser, and your server for server rendering |
| Peer dependencies | None | React 19, react-dom 19, @base-ui/react 1.3+ |
| TypeScript | 5.4+ | 5.4+ |
| Entry points | @nearai/financial-agents-sdk | @nearai/financial-agents-react, /model, /fixtures, /styles.css |
Money needs the user's signature
Creating the agent wallet, withdrawing and approving a trade each carry the user's wallet signature of the exact message Fin issued. Fin verifies it on arrival and again before anything is signed.
The approval card shows the exact terms of the contract Fin derived, never the model's words. A contract the card cannot read offers only Cancel: nobody approves terms they were not shown.