Build Abstraxn Smart Wallets in a new app
In this doc and the following ones, we will build a React application with Abstraxn Smart Wallets from scratch. This guide supports both Vite and Next.js setups.

Create a new React app

Choose your preferred framework: Start by initializing a new React application with Vite:
Or with other package managers:
pnpm
yarn

Option 2: Next.js

Start by initializing a new Next.js app:
This command passes in flags to use Typescript, Tailwind and the next app router.

Install Dependencies

You will need these core libraries:
  • @abstraxn/signer-react: Abstraxn Signer SDK React package for handling wallet interactions and transaction signing
  • @abstraxn/signer-core: Abstraxn Signer SDK core package (required dependency)
  • @tanstack/react-query: A required async state library for managing smart wallet state (learn more)
Install them with:
npm
pnpm
yarn

Setup AbstraxnProvider

The Abstraxn SDK requires wrapping your application with the AbstraxnProvider component. This provides the wallet context to all components in your app.

For Vite Projects

Update your src/main.tsx (or src/main.jsx) file:

For Next.js Projects

Update your app/layout.tsx (App Router) or pages/_app.tsx (Pages Router): app/layout.tsx (App Router):
pages/_app.tsx (Pages Router):
Note: Replace YOUR_API_KEY with your actual Abstraxn API key. You can obtain one from your Abstraxn Dashboard.

Enable Solana Gasless Transactions (Optional)

If your app supports Solana, add the solanaGasless option to your provider config. This sponsors transaction fees from your paymaster gas pool so users never need SOL for gas.
To get your relayer URL, go to the dashboard → Paymaster. If your app has Solana selected as a chain, you will see the Solana paymaster link there.

Next Steps

Now that you have the basic setup complete, you can: