Skip to main content
By the end of this guide, you’ll understand how to use each SDK callback function to respond to key events in the user journey.
Before you start

Overview

When a user interacts with Link, Mesh fires SDK events that you can respond to in your app. The four callback functions below cover the most important moments in the user journey: connecting an account, completing a transfer, exiting, and responding to granular in-flow events.

SDK callback functions

SDK-specific instructions for setting up callback functions

What’s next

Next up: Supercharge return-users — once you’re capturing accessTokens via onIntegrationConnected, you’re ready to set up Mesh Managed Tokens for a seamless return-user experience.
AI coding reference — a compact summary of this page’s APIs, parameters, and patterns for use by AI coding assistants (following the llms.txt standard). Human readers can safely ignore this.llms.txt — Use Mesh’s callback functionsThe 4 SDK callback functions for responding to key user journey events. Wire all 4 in every SDK initialization.onIntegrationConnected(payload) — fires when user connects an exchange or wallet. Key payload: accessToken.accountTokens[].tokenId (store this for MMT) | accessToken.brokerType | brokerBrandInfo (icons/logos)onTransferFinished(payload) — fires when transfer flow completes. Use for immediate UI updates only; use webhooks for business logic. Key payload: status (pending/succeeded/failed) | userId | transactionId | txId (exchange-specific) | transferId (Mesh-specific) | txHash | symbol | amount | amountInFiat | totalAmountInFiat | fromAddress | toAddress | refundAddress | networkId | networkNameonExit() — fires when user closes Link at any point. Key payload: errorMessage | summary.page | selectedIntegration (name + Id) | transfer.previewIdonEvent(ev) — fires for granular in-flow events. Use for analytics and specific UX logic. See Mesh SDK events guide for full event list.Critical: onTransferFinished fires when the provider acknowledges the request — not when it confirms on-chain. Always use webhooks for final confirmation before crediting users or releasing inventory.Web SDK — canonical initialization with all 4 callbacks: