Browser / SPA
Browser / SPA
Use integrationContext: 'client' when the SDK runs in the user’s browser.
The client talks to Nutrimatic over HTTPS for reads and writes. Whether writes are allowed is mode ('read' vs 'full'), not integrationContext.
import { createNutrimaticSdk } from '@nutrimatic/sdk'
const sdk = createNutrimaticSdk({
ledgers: [{ id: 'evm:421018', kind: 'evm', chainId: 421018, alias: 'infinite-mainnet' }],
mode: 'read',
integrationContext: 'client',
})
export async function loadMarketChart(pair: string) {
return sdk.easy.read.getChart({ pair, interval: '1h' })
}Initialise once (module singleton or React context) and reuse the same client across components. The SDK is framework-agnostic.
First-day path
Follow Quick start — First day for reads → wallet → balance → quote → swap → status. Then map screens:
| Screen you are building | Start here |
|---|---|
| Price chart | Chart windows |
| Recent trades / pool activity | Activity feeds |
| Swap | Swaps · Fees and costs |
| Portfolio (LP / stake / farm) | Positions |
| Connect wallet / sign | Wallet adapter · Whose wallet (owner) |
Related
| Goal | Start here |
|---|---|
| All read methods | Read operations |
| Swap, liquidity, settlement | Write operations |
| Balances, portfolio, stake, farm | Balances · Positions · Staking · Farming |
| Config | Configuration |