AppKit
instance that handles connection logic, manages various chain adapters, and provides data to your application via a React Context.
npm install ...
or yarn add ...
.For EVM-compatible chains, you can choose between the Ethers.js-based adapter or the Wagmi-based adapter. You should install the one that best fits your projectβs existing setup or preference.
This adapter uses Ethers.js for interacting with EVM chains.
To initialize the Ethers adapter:
AppKit
. This is where youβll configure your project ID (if using WalletConnect features) and define the chains your application will support, along with their respective adapters.
import "@walletconnect/react-native-compat";
is the very first line in your configuration file (e.g., AppKitConfig.ts
), even before other imports. This import handles necessary polyfills.AppKitProvider
to make the AppKit
instance available throughout your component tree via context.
<AppKit />
component in your application. If you want the modal to be accessible from anywhere in your app, itβs best to place this component within your main application root component (e.g., the YourAppRootComponent
from the example above, or directly in App.tsx
if it serves as your main layout).
createAppKit
function accepts a storage
option that must conform to the Storage
interface.
The Storage
interface, which can be imported from @reown/appkit-react-native
, is defined as follows:
@react-native-async-storage/async-storage
. Create a new file, for example src/StorageUtil.ts
, with the following content:
createAppKit
in your AppKitConfig.ts
. This example builds on the configuration from Initialize AppKit:
app.json
(or app.config.js
) file.infoPlist
object if it doesnβt exist, and within it, include the LSApplicationQueriesSchemes
array. This array will contain the desired wallet schemes you want to detect.LSApplicationQueriesSchemes
array.PhantomConnector
from @reown/appkit-solana-react-native
and add it to the extraConnectors
array in your createAppKit
configuration.
Hereβs how to update your AppKitConfig.ts
file, using the example from the Implementation section as a base:
cluster
option in PhantomConnector
can be set to 'mainnet-beta'
, 'devnet'
, or 'testnet'
depending on which Solana cluster you want to connect to.