Install the Startale AA SDK and pick a signer that fits your stack.
This page covers the framework-agnostic setup: installing the SDK, configuring environment variables, and choosing a signer. The SDK does not assume Next.js, React, wagmi, or any particular auth provider; pick whichever signer fits your project.
The SDK source is at StartaleGroup/scs-aa-sdk and the published package is @startale-scs/aa-sdk.
The SDK takes the bundler URL, paymaster URL, and paymasterId at call time. Where you store them is up to your framework. A plain .env file works for any Node-based runtime:
Keep your API key on the server when possible. If you must expose it to the browser (for example, in a single-page app without a backend), prefer per-domain SCS API keys with a tight gas policy so a leak has bounded blast radius. The SDK does not require any specific environment variable prefix; framework-specific prefixes like NEXT_PUBLIC_* or VITE_* are not part of the SDK’s contract.
toStartaleSmartAccount accepts any of the signer types below. The choice is yours and depends on how your app already manages keys.
import { toStartaleSmartAccount } from "@startale-scs/aa-sdk"const account = await toStartaleSmartAccount({ signer, // pick one of the four shapes below chain, transport: http(), index: 0n,})
Viem LocalAccount (server / scripts)
Viem WalletClient (browser, raw viem)
EIP-1193 provider (Privy, Dynamic, MetaMask)
Ethers Wallet (legacy code)
A LocalAccount holds a private key directly. Best for backend services, scheduled jobs, or developer scripts.
import { privateKeyToAccount } from "viem/accounts"const signer = privateKeyToAccount(process.env.OWNER_PRIVATE_KEY as `0x${string}`)
Symbol
Source
Role
privateKeyToAccount
viem/accounts
Builds a LocalAccount from a hex private key.
A WalletClient is the viem object wrapping a connected browser wallet. Best for browser apps that use viem directly.
import { createWalletClient, custom } from "viem"import { soneiumMinato } from "viem/chains"const signer = createWalletClient({ account: connectedAddress as `0x${string}`, chain: soneiumMinato, transport: custom(window.ethereum!),})
Symbol
Source
Role
createWalletClient / custom
viem
Build a wallet client over an EIP-1193 provider.
soneiumMinato
viem/chains
Soneium Minato chain definition (chain id 1946).
Pass the raw provider straight to toStartaleSmartAccount. The SDK calls eth_accounts internally to resolve the signing address.
If your app already uses wagmi for connection state, you can keep wagmi for connection management and feed its WalletClient into toStartaleSmartAccount as a signer. wagmi is not required by the SDK.
import { useWalletClient } from "wagmi"import { toStartaleSmartAccount } from "@startale-scs/aa-sdk"import { http } from "viem"import { soneiumMinato } from "viem/chains"const { data: walletClient } = useWalletClient()const account = await toStartaleSmartAccount({ signer: walletClient!, // viem WalletClient from wagmi chain: soneiumMinato, transport: http(), index: 0n,})
Symbol
Source
Role
useWalletClient
wagmi
Hook that returns a viem WalletClient for the currently connected wallet.
toStartaleSmartAccount
@startale-scs/aa-sdk
Builds the smart account from any supported signer.
http
viem
HTTP transport used by the smart account for RPC reads.