Skip to main content
Install the SDK, make your first deposit, and verify the balance. Under 30 minutes from zero to working code.
Before you start, you need a portal account with at least one active account type. You also need an API key for your server.
1

Install the SDK

The SDK is built for Node.js backends.
2

Initialize the SDK

blend-server.ts
The accountTypeId is the slug you chose when creating your account type in the portal.
3

Look up the account

lookup.ts
Pass the user’s EOA address. Blend returns their account ID and Safe address. lookupAccount creates the account if it doesn’t exist yet, but does not deploy a Safe. To deploy, scope the account with forAccount and call safe.request(chainId), shown below.
chainsDeployed only lists chains where the Safe is live. Before your first deposit, check that the deposit chain is deployed:
See Safe deployment for the full pattern.
4

Scope to the account

scope.ts
All session and balance operations go through this scoped client. It has client.discover, client.account, and client.sessions.
5

Create a session and quote

session-quote.ts
Pass the token address as inputAssetAddress. Quote methods return a SessionResult. Narrow on type before reading its quote summary or extracted action plan. The session stays open until you lock it, cancel it, or it expires, which usually takes about 15 minutes.
6

Execute the session

execute-server.ts
The SDK locks the quote before it calls your signer, executes each action plan in order, and submits the returned transaction hashes. Vault accepts the hashes and moves the session directly from LOCKED to SETTLED. It does not verify transaction receipts. Repeating the same submission returns the settled session.
7

Check the balance

balance-server.ts
The balance updates after Blend’s indexer processes the on-chain events. This usually takes under a minute.

What just happened

Your deposit followed this path:
  1. The SDK created a session and requested a quote from Blend’s API.
  2. Blend built the deposit transaction for your account type’s vault, including any required bridge steps.
  3. Your server signer submitted the transaction on-chain and paid the gas.
  4. Funds landed in the user’s Safe and went into that vault.
The user’s Safe is a real Gnosis Safe. Only whitelisted modules can move funds. The user retains ownership at all times.

What to watch out for

Don’t create a new session for every quote. Call quoteDeposit again on the same OPEN session to update the amount, token, or chain. Use forceReset: true only when you want to discard the active session. Don’t skip error handling. Quotes expire, flow plans can conflict with deposits, and signing can fail. Check error.isRetryable() before retrying. Don’t hard-code chain IDs or token addresses. Use discover.depositChains() and discover.depositTokens() to build your UI dynamically.

Go-live checklist

1

Store API keys safely

Keep production keys in environment variables or a secrets manager. Never log them or commit them to version control.
2

Rotate API keys

Create fresh API keys for production. Don’t reuse development keys. Deactivate any test keys.
3

Test end-to-end

Make a real deposit and withdrawal on each supported chain. Verify balances update correctly. Test with amounts under $1 to keep costs low.
4

Confirm vault config

Check that your account type’s vault config is Active (not Pending or Provisioning). Deposits to an account type without active infrastructure will fail.
5

Set flow plan mode

Decide whether to auto-approve flow plans or review them manually. Auto-approve is simpler but gives you less control over rebalancing timing.
6

Verify error handling

Test your app’s behavior for expired quotes, signing failures, and FLOWPLAN_CONFLICT errors. Users should see helpful messages, not stack traces.
Once you’ve completed the checklist, your integration is production-ready. Deposits, withdrawals, and rebalancing will work end-to-end.

Using the SDK

Full method reference for account management and session lifecycle.

Deposits and withdrawals

Cross-chain routing, re-quoting, and withdrawal coordination.

Best practices

Credential security, session management, and error recovery patterns.
Last modified on November 25, 2026