In this doc and the three following we will build a Next.js application with Alchemy Smart Wallets from scratch. If you're using any other tech stack, follow along with the key points of integration and adjust as needed!
Start by initializing a new Next.js app. Run:
npx create-next-app@latest \
--typescript \
--tailwind \
--appThis command passes in flags to use Typescript, Tailwind and the next app router. The following docs in this guide will expect you to use these.
You will need these three libraries:
- @account-kit/infra: Core interfaces and functions for Smart Wallets (learn more)
- @account-kit/react: React Hooks, components and utilities for Smart Wallets (learn more)
- @tanstack/react-query: A required async state library to make smart wallet react hooks easier to use (learn more about this library's motivation here)
Go ahead and install them to the project with a single command:
npm install @account-kit/infra @account-kit/react @tanstack/react-query