Learn how to integrate Abstract Global Wallet into an existing Privy application
agw-react
package provides an AbstractPrivyProvider
component,
which wraps your application with the PrivyProvider
as well as the Wagmi and TanStack Query providers; allowing you to use the features of each library with Abstract Global Wallet.
AbstractPrivyProvider
component, providing your
as the appId
prop.
use client
directive at the top of your file (see
example)
and wrap your application in this component.useAbstractPrivyLogin
hook to prompt users to login with Abstract Global Wallet.
login
function uses Privy’s loginWithCrossAppAccount
function to authenticate users with their Abstract Global Wallet account.
link
function uses Privy’s linkCrossAppAccount
function to allow authenticated users to link their existing account to an Abstract Global Wallet.
agw-react
hooks,
such as useWriteContractSponsored
as well as all of the existing wagmi hooks; such as useAccount,
useBalance, etc.
All transactions will be sent from the connected AGW smart contract wallet (i.e. the tx.from
address will be the AGW smart contract wallet address).