Skip to main content

Overview

This step-by-step guide shows how to integrate thirdweb’s Account Abstraction SDK on Sei. By the end of the guide, you will know how to set up wallet connection with social logins and build dApps with sponsored gas.

What this guide covers

  • Core concepts and the benefits for user experience
  • Creating a React application with the thirdweb SDK and Vite
  • Setting up social logins and gasless transactions
  • Interacting with smart contracts

Prerequisites

Before you start, make sure that you have:
  • Node.js v18 or later installed
  • Basic knowledge of React and TypeScript
  • A thirdweb account with an API key from the thirdweb dashboard
  • A smart contract deployed on Sei (this guide uses a simple Storage contract)
For Sei Mainnet: Gas sponsorship requires an active thirdweb Pay As You Go subscription ($5/month minimum).

What is account abstraction?

Account abstraction (AA) changes how users interact with dApps. Instead of traditional externally owned accounts (EOAs), users get smart contract wallets that support advanced features.

Core concepts

  • Smart wallets: Contract-based accounts with programmable logic
  • Gas sponsorship: dApps pay transaction fees for users
  • Social recovery: Authentication methods other than private keys
  • Batch transactions: Multiple operations in a single transaction

Network information

Sei Mainnet configuration

  • Network name: SEI EVM
  • Chain ID: 1329
  • Public RPC URL: https://evm-rpc.sei-apis.com
  • Explorer: https://seiscan.io/
  • Currency: SEI
  • thirdweb RPC: https://1329.rpc.thirdweb.com/{YOUR_CLIENT_ID}

Step 1: Deploy a Storage contract

Before you integrate the SDK, deploy a simple Storage contract on Sei. This contract stores and retrieves a number.

Storage contract (Solidity)

Storage.sol
Use Remix to deploy this contract on Sei. Save the contract address, because you need it in the code.

Step 2: Project setup

Create a new project

Install dependencies

Configure environment variables

Create a .env file in your project root:
.env
Get your Client ID from the thirdweb dashboard under Settings → API Keys.

Enable gas sponsorship

To sponsor gas on Sei Mainnet:
  1. Go to the billing settings in the thirdweb dashboard.
  2. Subscribe to the Pay As You Go plan ($5/month).
  3. Without this plan, sponsored transactions fail on Sei Mainnet.

Step 3: Configure thirdweb client

Create src/client.ts:
src/client.ts

Step 4: Smart contract integration

Replace the contents of src/App.tsx with this code:
src/App.tsx

Understanding key components

Step 5: Package configuration

Make sure that your package.json includes these entries:
package.json

Step 6: Run the application

Start development server

Test the application

  1. In your browser, go to http://localhost:5173.
  2. Click Connect to Sei Network.
  3. Choose your preferred login method, such as Google or email.
  4. A smart wallet is created for you automatically. You do not pay gas for it.
  5. After you connect, you see three interaction buttons.
  6. Store the number 37 or a custom number.
  7. Retrieve the stored value. All transactions are gasless.
  8. Monitor the browser console for these items:
    • Transaction hashes
    • Error messages
    • Connection status
    • Smart contract interactions
Gas is sponsored automatically when you use account abstraction, so users do not need SEI tokens to interact with the contract.

Step 7: Done!

Your dApp now uses thirdweb’s Account Abstraction SDK on Sei. Users can connect with social logins and interact with your contracts without holding SEI tokens for gas.

What you’ve accomplished

  • Created a React application with the thirdweb SDK v5
  • Configured account abstraction for Sei
  • Implemented social login authentication
  • Enabled gasless transactions
  • Built contract interaction interfaces
  • Learned error handling for dApps

Troubleshooting

Common issues and solutions

Network connection issues

If the RPC endpoint does not respond:
  1. Make sure that your Client ID is active.
  2. Check your internet connection.
  3. Try the public RPC endpoint: https://evm-rpc.sei-apis.com

Resources