Installation
SDK (Required)
The core SDK provides wallet creation, policy management, transaction execution, and session key support.
npm install @smartagentkit/sdk
# or
pnpm add @smartagentkit/sdk
# or
yarn add @smartagentkit/sdkLangChain Integration (Optional)
Drop-in tools for using SmartAgentKit from a LangChain agent.
npm install @smartagentkit/langchain @langchain/coreRequires @langchain/core as a peer dependency. If you are using a specific LLM provider (e.g., @langchain/openai, @langchain/anthropic), install that separately.
Testing Package (Optional)
In-memory mock client for testing agent workflows without deploying contracts or funding wallets.
npm install -D @smartagentkit/testingThis is a dev dependency -- you should not ship it in production.
CLI (Optional)
Command-line interface for creating wallets, managing policies, and monitoring status.
npm install -g smartagentkit
# Provides the `sak` commandAfter installation, initialize your configuration:
sak config initEnvironment Setup
Create a .env file in your project root:
RPC_URL=https://base-sepolia.g.alchemy.com/v2/YOUR_KEY
BUNDLER_URL=https://api.pimlico.io/v2/84532/rpc?apikey=YOUR_KEY
OWNER_PRIVATE_KEY=0x...RPC URL
Any Base Sepolia JSON-RPC endpoint. Options:
- Alchemy (free tier available)
- Infura (free tier available)
- Public RPC:
https://sepolia.base.org(rate-limited, not recommended for production)
Bundler URL
An ERC-4337 bundler is required to submit UserOperations. SmartAgentKit is tested with Pimlico:
- Sign up at pimlico.io
- Create a project and select Base Sepolia (chain ID
84532) - Copy your API key into the bundler URL
Owner Private Key
The private key of the wallet owner account. This key:
- Signs UserOperations to authorize transactions
- Pays for gas (unless a paymaster is configured)
- Controls policy changes and wallet administration
WARNING
Never commit your private key to version control. Use .env files and add .env to your .gitignore.
For Solidity Developers
If you want to extend the policy modules, write custom hooks, or deploy contracts to new chains:
Install Foundry
curl -L https://foundry.paradigm.xyz | bash
foundryupClone and Build
git clone https://github.com/smartagentkit/smartagentkit.git
cd smartagentkit/packages/contracts
forge install
forge buildRun Tests
forge testDeploy to a New Chain
forge script script/Deploy.s.sol \
--rpc-url $RPC_URL \
--broadcast \
--verifyThis deploys all four modules: SpendingLimitHook, AllowlistHook, EmergencyPauseHook, and AutomationExecutor.
Verify Your Setup
Run this script to confirm everything is working:
import { SmartAgentKitClient } from "@smartagentkit/sdk";
import { baseSepolia } from "viem/chains";
const client = new SmartAgentKitClient({
chain: baseSepolia,
rpcUrl: process.env.RPC_URL!,
bundlerUrl: process.env.BUNDLER_URL!,
});
console.log("SmartAgentKit client created successfully");
console.log(`Chain: ${client.chain.name} (${client.chain.id})`);If this runs without errors, your environment is correctly configured.
Next Steps
- Quickstart — Deploy your first agent wallet
- Core Concepts — Understand the architecture