If there is an existing TON dApp that uses TON Connect’s React library, migrate that dApp from
@tonconnect/ui-react to AppKit.Initialization
The basic kit initialization consists of creating a corresponding object by passing it a minimal set of necessary arguments: TON networks to operate on. This allows for direct API requests but is insufficient for connecting TON wallets via the TON Connect protocol. For that, configure a connector and host a public app manifest file.TanStack Query
TanStack Query is an opinionated library that simplifies fetching, caching, synchronizing and updating server state in web applications. To also setup the TanStack Query for React, wrap the application inQueryClientProvider from @tanstack/react-query inside AppKitProvider.
Queries and mutations
AppKit provides a separate entry point@ton/appkit/queries that contains standardized options for the TanStack Query (v5). It is not included automatically, keeping an application lightweight if unused.
These options are framework-agnostic and allow integrating AppKit with TanStack Query in any environment, such as React, Vue, Svelte, Solid, etc. Queries handle caching, background refetching, and state management for blockchain data.
Import query and mutation options directly from the queries entry point:
Configuration parameters
Required
For one or more TON networks, configure their respective API or RPC providers to interact with.It is also possible to provide an entirely custom provider with its own
TypeScript
ApiClient interface implementation.TypeScript
Optional
Array of connectors that enable wallet connections. The primary connector is
TonConnectConnector.Each connector must expose the following methods:initialize()— creates the connector, restores connections, sets up event listeners.destroy()— cleans up connector resources.connectWallet()— connects a wallet through the UI.disconnectWallet()— disconnects a wallet.getConnectedWallet()— lists connected wallets.
Array of DeFi providers that enable additional functionality, such as asset swaps via Omniston.