From abstract-skills
Integrate Abstract Global Wallet (AGW) into React apps with email/social/passkey login, smart contract wallets, session keys, gas sponsorship, and provider integrations for Abstract Ethereum L2.
npx claudepluginhub abstract-foundation/abstract-skillsThis skill uses the workspace's default tool permissions.
AGW is Abstract's cross-application smart contract wallet. Users sign up once (email, social, passkey) and use it across all Abstract apps. **Recommended over standard wallet connections for new Abstract apps** — see the decision table below for when to consider alternatives.
Selects optimal Circle wallet type (developer-controlled, user-controlled, modular) for onchain apps by comparing custody, auth methods, account types (EOA/SCA/MSCA), and blockchain support. Guides implementation for wallet integrations.
Integrates Privy for authentication, embedded/smart wallets (ERC-4337), and agent payments (x402/MPP) in React/Next.js apps and Node.js backends. Use for crypto auth, Tempo chain, wallet policies, or agentic flows.
Builds frontend Solana apps with Phantom Connect SDK for React, React Native, and browser, plus Helius for transaction signing, NFT minting, payments, real-time updates, and secure architecture.
Share bugs, ideas, or general feedback.
AGW is Abstract's cross-application smart contract wallet. Users sign up once (email, social, passkey) and use it across all Abstract apps. Recommended over standard wallet connections for new Abstract apps — see the decision table below for when to consider alternatives.
For AI agent wallet access (not end-user facing), see the using-agw-mcp skill instead.
npx @abstract-foundation/create-abstract-app@latest my-app
This scaffolds a React app with AGW pre-configured.
npm install @abstract-foundation/agw-react @abstract-foundation/agw-client wagmi viem@2.x @tanstack/react-query
viem must be 2.x. Using viem 1.x causes compatibility errors.
import { AbstractWalletProvider } from "@abstract-foundation/agw-react";
import { abstractTestnet } from "viem/chains"; // or abstract for mainnet
export default function App() {
return (
<AbstractWalletProvider chain={abstractTestnet}>
{/* Your app */}
</AbstractWalletProvider>
);
}
import { useLoginWithAbstract } from "@abstract-foundation/agw-react";
export default function LoginButton() {
const { login, logout } = useLoginWithAbstract();
return <button onClick={login}>Login with Abstract</button>;
}
import { useAbstractClient } from "@abstract-foundation/agw-react";
export default function SendTx() {
const { data: abstractClient } = useAbstractClient();
async function send() {
if (!abstractClient) return;
const hash = await abstractClient.sendTransaction({
to: "0x...",
data: "0x...",
});
}
return <button onClick={send}>Send</button>;
}
import { useWriteContractSponsored } from "@abstract-foundation/agw-react";
import { getGeneralPaymasterInput } from "viem/zksync";
export default function SponsoredMint() {
const { writeContractSponsored, isPending } = useWriteContractSponsored();
return (
<button
disabled={isPending}
onClick={() =>
writeContractSponsored({
abi: contractAbi,
address: "0xContractAddress",
functionName: "mint",
args: ["0xRecipient", BigInt(1)],
paymaster: "0xPaymasterAddress",
paymasterInput: getGeneralPaymasterInput({ innerInput: "0x" }),
})
}
>
Mint (Gas Free)
</button>
);
}
| Use Case | AGW | Standard (MetaMask/EOA) |
|---|---|---|
| New Abstract app | Yes | No |
| Cross-app wallet identity | Yes | No |
| Email/social login | Yes | No |
| Session keys (gasless UX) | Yes | No |
| Gas sponsorship | Yes | Paymaster only |
| Existing wallet user base | Consider both | Yes |
| Use Case | Session Keys | Direct Approval |
|---|---|---|
| Games / frequent actions | Yes | No |
| One-time transactions | No | Yes |
| No-popup UX | Yes | No |
| High-value transactions | No | Yes |
| Testnet | Yes | Yes |
| Mainnet | Requires security review | Yes |
| Feature | Where to look |
|---|---|
| React hooks API | references/react-hooks.md |
| Session keys (create, use, revoke) | references/session-keys.md |
| Third-party wallet providers | references/wallet-providers.md |
| Package | Purpose |
|---|---|
@abstract-foundation/agw-react | React hooks + AbstractWalletProvider. Built on Wagmi. |
@abstract-foundation/agw-client | Wallet actions + session key utilities. Built on Viem. |
abstract or abstractTestnet — AbstractWalletProvider throws on unsupported chainslocalStorage; use encrypted browser storage or server-side KMSapprove/setApprovalForAll in session policies must include constraints restricting to a specific contract address, or the registry will reject