Adapters
The thirdweb SDK can work side by side with:
- wagmi
- viem
- privy
- ethers.js v5
- ethers.js v6
- older versions of the @thirdweb-dev/sdk (using the ethers.js v5 adapter)
- any other library that conforms to the EIP-1193 standard
Adapters allow you to use contracts, providers and wallets from these libraries with the thirdweb SDK and vice versa.
You can use in-app and ecosystem wallets in your wagmi application by using the @thirdweb-dev/wagmi-adapter
package.
Make sure you're running wagmi 2.14.1 or above.
You probably already have a wagmi config with some connectors, simply add the inAppWalletConnector to the list, along with the desired options.
Then in your application, you can use the connector to trigger the in-app wallet connection.
You can use the thirdweb SDK within a wagmi application by setting the wagmi connected account as the thirdweb 'active wallet'. After that, you can use all of the react components and hooks normally, including PayEmbed
, TransactionButton
, etc.
You can view a fully functioning wagmi + thirdweb app in this github repository.
Similarly, you can use the thirdweb SDK with privy by setting the privy wallet as the thirdweb 'active wallet'. After that, you can use all of the react components, functions and hooks normally, including PayEmbed
, TransactionButton
, etc.