Migration from Solana Anza Adapter to AppKit
Follow the steps below to migrate from the Starter Pack of Anza Adapter to AppKit. Based on the default implementation. Our starting point is the Anza Adapter Starter Pack in Github.
Step 1. Integrate Solana Appkit
a. Create a project in Reown Cloud
- Create a new project on Reown Cloud and obtain a new project ID.
b. Uninstall old packages and install the AppKit packages:
c. Add imports to the top of the App.tsx
Remove old imports:
Add the new imports:
Update the code:
Email an social logins are enabled by default.
d. Update the App.tsx
component
Use the AppKit Button. It can be configure following these guidelines.
AppKit’s web components are global HTML elements that don’t require importing.
e. Create the .env
file with the projectId
Step 2. Interact with the Solana network
After integrating AppKit, you can interact with the Solana network using the @solana/web3.js
library.
You can check our example on how to fully interact or read our documentation for more information.
a. Add all the imports you need to interact with the Solana network:
b. call the hooks useWeb3ModalAccount
and useWeb3ModalProvider
:
c. Create a function to generate a transaction:
d. Call the function:
e. Install and Run the Solana AppKit Project.
Install dependencies:
Start the project:
Final notes
- Check our Solana AppKit React Docs for more information on how to customize your project.
- Test your application thoroughly to ensure that the migration has been successful and that all functionality is working as expected.
Was this page helpful?