Before you start
- You have the Mesh SDK initialized and launching (see Launch the Mesh SDK)
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 callback function | Description | Key uses | Payload details |
|---|---|---|---|
onIntegrationConnected() | Allows you to run specific business logic when the user has successfully completed connecting an account. | Capture accessTokens to: • pass to Mesh SDK for a return-user experience • pass to Mesh endpoints to get user deposit addresses or balances | • accessToken: the access and refresh tokens to the connected account with some basic metadata about the account and tokens• brokerBrandInfo: links to icons and logos for the connected integration |
onTransferFinished() | Allows you to run specific business logic when the user has successfully completed a transfer. | Show user a banner or notification acknowledging a pending transaction. Example: “Your 99.99 USDC deposit is pending and will be credited to your account when it receives enough network confirmations.” | • status: pending / succeeded / failed• txId: A unique client identifier• transferId: A unique Mesh identifier• txHash?: A unique blockchain identifier• fromAddress: Address transfer is sent from• toAddress: Address transfer is sent to• symbol: Symbol of asset being transferred• amount: Amount being transferred• amountInFiat: Fiat equivalent of transfer amount• totalAmountInFiat: Total amount transferred, including transfer-related fees• networkId: Selected network identifier• networkName: Selected network name• refundAddress: The address that the user can receive back to |
onExit() | Allows you to run specific business logic when the user has exited Link at some point. | Show the user some experience when they exit Link without successfully completing a transfer. | • errorMessage: Descriptive error message, if applicable• summary: // optional• page: the page the user was on when they exited• selectedIntegration: Name and Id of integration• transfer: previewId and other details about the transfer preview |
onEvent() | Allows you to run specific business logic in more granular scenarios, like when the user exits Link from specific parts in the user journey. The events that can be used in this callback function are listed below. | Different payload structure for different events |
SDK-specific instructions for setting up callback functions

Web SDK initialization structure
Web SDK initialization structure

iOS Native SDK initialization structure
iOS Native SDK initialization structure

Android Native SDK initialization structure
Android Native SDK initialization structure

ReactNative SDK initialization structure
ReactNative SDK initialization structure

Flutter SDK initialization structure
Flutter SDK initialization structure
What’s next
Next up: Supercharge return-users — once you’re capturingaccessTokens via onIntegrationConnected, you’re ready to set up Mesh Managed Tokens for a seamless return-user experience.
AI coding reference (llms.txt)
AI coding reference (llms.txt)
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) | transferId | 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: