Skip to main content
This recipe shows how to wire up the @mocanetwork/airkit-connector package so your React app can use wagmi hooks (useAccount, useConnect, useSendTransaction, etc.) with AIR Kit smart accounts.

Prerequisites

  • A React project with wagmi v2+ installed
  • AIR Kit SDK installed: npm install @mocanetwork/airkit @mocanetwork/airkit-connector
  • A Partner ID from the Developer Dashboard

Step 1: Create the wagmi config

Step 2: Wrap your app with WagmiProvider

Step 3: Connect and use the account

Step 4: Access AirService from the connector

Once connected, you can access the underlying AirService for credential operations:

Step 5: Send a transaction

With the connector active, standard wagmi transaction hooks work against the user’s AIR Kit smart account:

Next steps