React SDK
The React SDK includes the TypeScript client surface plus React Query helper hooks for application data loading and mutations.
Package
| Field | Value |
|---|---|
| Package | @f-wallet/react |
| Version | 0.1.0 |
| Repository | f-wallet/fwallet-js |
| Peer dependency | @tanstack/react-query |
npm install @f-wallet/react @tanstack/react-queryClient setup
import { Configuration, WalletsApi, useFWalletQuery } from "@f-wallet/react";
const config = new Configuration({ basePath: "https://api.fwallet.co.ug", apiKey: "fwk_live_...",});
const wallets = new WalletsApi(config);
export function WalletList() { const query = useFWalletQuery("wallets.list", wallets.walletsGetWallets.bind(wallets), {});
if (query.isLoading) return null;
return query.data?.data.map((wallet) => <div key={wallet.id}>{wallet.ownerId}</div>);}Hook helpers
| Helper | Purpose |
|---|---|
fwalletQueryKey(scope, params) | Builds a stable React Query key. |
useFWalletQuery(scope, apiCall, params, options) | Runs a generated SDK API method as a query. |
useFWalletMutation(apiCall) | Runs a generated SDK API method as a mutation. |
Resource clients
| Resource | Class |
|---|---|
| Admin | AdminApi |
| Auth | AuthApi |
| Deposits | DepositsApi |
| Developer | DeveloperApi |
| Health | HealthApi |
| Journal | JournalApi |
| Payouts | PayoutsApi |
| System | SystemApi |
| Team | TeamApi |
| Tenants | TenantsApi |
| Transfers | TransfersApi |
| Wallets | WalletsApi |
Operation methods
The React SDK uses the same generated method names as the TypeScript SDK. See the TypeScript operation reference.