Alchemy AccountKit


With Account Kit, you can create a smart account for every user in your application. With Account Kit, a new user will:

  • Create a smart account directly in your app without third-party downloads

  • Submit transactions without needing ETH in their account for gas

  • Submit transactions in the background without leaving your app

Enabled by ERC-4337, Account Kit makes it possible to build a web3 app that feels like web2: simple and familiar for mainstream users.

Getting Started

Get started with Account Kit at

Connecting Alchemy Account Kit to a Capsule Signer

import { AlchemyProvider } from "@alchemy/aa-alchemy";
import {
} from "@alchemy/aa-accounts";
import { WalletClientSigner, type SmartAccountSigner } from "@alchemy/aa-core";
import { http } from "viem";
import { sepolia } from "viem/chains";

const CHAIN = sepolia;

// create capsule viem client
const viemClient = createCapsuleViemClient(capsule, {
  chain: CHAIN,
  transport: http(PROVIDER),

// create smart account signer type
const capsuleAccountKitSigner: SmartAccountSigner = new WalletClientSigner(
  "capsule" // signerType

const provider = new AlchemyProvider({
  apiKey: "ALCHEMY_API_KEY",
  (rpcClient) =>
    new LightSmartContractAccount({
      owner: capsuleAccountKitSigner,
      factoryAddress: getDefaultLightAccountFactoryAddress(chain),

Note: for simplicity, Capsule imports are not included in the above- It is assumed that the Capsule object has been instantiated and the user has created a wallet. If you need access to Capsule or help getting set up, please see the Getting Started section

Last updated