Learn how to integrate Para wallet management plugin with Solana Agent Kit
This documentation provides a comprehensive guide for integrating the Para wallet management plugin with Solana Agent Kit v2. Para offers advanced wallet management features that can be seamlessly incorporated into your Solana-powered applications.
Para is a wallet management solution that provides:
Non-custodial wallet creation and management
Smart wallet capabilities
Transaction batching and management
Multi-chain support
Embedded wallet experiences
When integrated with Solana Agent Kit, Para enables your applications to create and manage wallets without requiring users to install browser extensions or manage private keys.
# Install the Para pluginsnpm install @getpara/plugin-para-server @getpara/plugin-para-web# or with pnpmpnpm add @getpara/plugin-para-server @getpara/plugin-para-web# or with yarnyarn add @getpara/plugin-para-server @getpara/plugin-para-web
Configure environment variables:
Copy
# Server-side variablesPARA_API_KEY=your_para_api_keyPARA_ENV=BETA # or PROD for productionRPC_URL=your_solana_rpc_urlSOLANA_PRIVATE_KEY=your_solana_private_key# Client-side variablesNEXT_PUBLIC_PARA_API_KEY=your_para_api_keyNEXT_PUBLIC_PARA_ENV=BETA # or PROD for production
// lib/solana-client.tsimport { SolanaAgentKit } from "solana-agent-kit";import ParaWebPlugin from "@getpara/plugin-para-web";// Initialize Solana Agent Kit (minimal client config)const solanaAgent = new SolanaAgentKit({ publicKey: "dummy", // Not used for client, but required});// Add Para pluginexport const solanaAgentWithPara = solanaAgent.use( ParaWebPlugin({ apiKey: process.env.NEXT_PUBLIC_PARA_API_KEY!, environment: process.env.NEXT_PUBLIC_PARA_ENV as "BETA" | "PROD", }));// Export Para instance for direct useexport const para = solanaAgentWithPara.methods.getParaInstance();
// Authenticate a user with their Para walletconst authResult = await solanaAgentWithPara.methods.authenticateParaWallet({ email: "user@example.com",});// Get auth link that was sent to the user's emailconst authLink = authResult.authLink;
// Send SOL using Para walletconst tx = await solanaAgentWithPara.methods.sendSolFromParaWallet({ walletId: "para-wallet-id", recipient: "recipient-address", amount: 0.1, // SOL amount});
// Get wallet detailsconst wallet = await solanaAgentWithPara.methods.getParaWallet({ walletId: "para-wallet-id",});// Get all wallets for an emailconst wallets = await solanaAgentWithPara.methods.getParaWalletsByEmail({ email: "user@example.com",});