Platform SDKs
Start with API & SDK coverage for the full HTTP→SDK matrix. Use torque-node@^0.1.1 on the server, @torquefi/react in the browser via a BFF, and torque-checkout / torque-webhooks for merchant flows.
Install matrix
| Package | Use when | Guide |
|---|---|---|
| torque-node | Unified server client — Intelligence, Assistant, Opportunities, capabilities | Docs |
| torque-intelligence | Intelligence + Opportunities only (getFeed, getYieldOpportunities, …) | Docs |
| torque-assistant | Assistant chat + SSE only | Docs |
| @torquefi/types | Shared types — /intelligence, /assistant, /platform, /opportunities | Docs |
| @torquefi/react | BFF-oriented React hooks — feeds and Assistant (not opportunities yet) | Docs |
| torque-checkout | Merchant checkout sessions and embed UI | Docs |
| torque-webhooks | Inbound webhook verify + outbound order status push | Docs |
# Backend: one client for feeds + assistant + opportunities
yarn add torque-node@^0.1.1
# Split clients (tree-shaking / single-surface apps)
yarn add torque-intelligence@^0.1.1 torque-assistant@^0.1.0
# Types only
yarn add @torquefi/types@^0.1.1
# React UI (plus server BFF with torque-node)
yarn add @torquefi/react @torquefi/types@^0.1.1
# Merchant checkout + webhooks
yarn add torque-checkout torque-webhooksPlatform packages: @torquefi/types, torque-intelligence, and torque-node at 0.1.1 (Opportunities release). torque-assistant, @torquefi/react, and torque-webhooks remain at 0.1.0.
Authentication
Platform SDKs use a business API key (sk_live_…) server-side only. React hooks never see the key — they call your BFF. See Authentication for the full credential table (business key vs smart wallet JWT for Actions).
Environment variables
| TORQUE_API_KEY | sk_live_… — required for torque-node and BFF routes |
| TORQUE_BASE_URL | Optional — defaults to https://app.torque.fi/api/v1 |
| ORDER_WEBHOOK_SECRET | Inbound order-update verification (torque-webhooks) |
| TORQUE_WEBHOOK_SECRET | Outbound webhook signing when Torque ships merchant webhooks |
Integrator patterns
| Use case | Use |
|---|---|
| "Earn X% on idle cash" tiles | GET /api/v1/opportunities/yield |
| "Borrow USD at X%" tiles | GET /api/v1/opportunities/lending → borrowAction |
| Macro/news rail with lend links | GET /api/v1/intelligence/feed |
| React dashboard | @torquefi/react BFF + torque-node |
| Merchant payments | torque-checkout |
See Opportunities API for yield vs lending vs Intelligence vs Actions boundaries.
OpenAPI and raw HTTP
Skip SDKs when you need a non-Node stack or want generated clients from the spec. Use OpenAPI 3.1 (GET /api/v1/openapi) or the domain HTTP guides under Platform API.
Per-package guides
torque-node
Unified server client — Intelligence, Assistant, Opportunities, capabilities
torque-intelligence
Intelligence + Opportunities only (getFeed, getYieldOpportunities, …)
torque-assistant
Assistant chat + SSE only
@torquefi/types
Shared types — /intelligence, /assistant, /platform, /opportunities
@torquefi/react
BFF-oriented React hooks — feeds and Assistant (not opportunities yet)
torque-checkout
Merchant checkout sessions and embed UI
torque-webhooks
Inbound webhook verify + outbound order status push