Backend only
Run the SDK from a Node.js server, a Next.js API route, or any server-side environment. Your frontend talks to your backend. Your backend talks to Blend.@blend-money/sdk) and direct API calls to /extern/:neobankId/:accountTypeId/*.
Bootstrap accounts first
Every SDK method that reads or writes user data requires anaccountId. You get it by calling client.safe.account(userEoa). This is the first call you make for any user.
accountId, you cannot:
- Fetch balances, positions, or returns
- Request deposit quotes
- Generate withdrawal calldata
- Resolve or deploy Safes on specific chains
accountId to every subsequent call.
Persist the account mapping
Store the BlendaccountId against your internal user ID. You need this mapping for every future request on behalf of that user.
Handle Safe deployment
A resolved account does not mean the Safe is deployed on-chain. Before the user’s first deposit on a chain, check deployment status and request deployment if needed.Don’t retry 409 conflicts
A409 response on withdrawal means a rebalance is in progress. Don’t silently retry. Surface it as a product-level message to the user. The rebalance will complete on its own. Retry the withdrawal once the account settles.
Next steps
SDK Accounts
Full reference for account bootstrapping and read APIs.
Deposit & Withdraw
End-to-end deposit and withdrawal flows.