Use this prompt with your preferred AI assistant (Claude, ChatGPT, etc.) to automatically add Solana embedded wallet functionality to your existing Civic Auth integration.
## Prerequisites CheckBefore starting, verify the user has:1. Existing Civic Auth integration in their React/Next.js project2. A working Civic Auth Client ID3. Basic authentication already functionalIf any of these are missing, stop and direct them to set up basic Civic Auth first.## TaskAdd Solana embedded wallet functionality to an existing Civic Auth integration.## Step 1: Fetch the Solana DocumentationUse curl to fetch the Solana embedded wallets documentation:curl https://docs.civic.com/web3/solana.mdThis documentation contains ALL the code examples and instructions needed for Solana wallet integration. Do NOT use web search or any other tools - only use curl to fetch this specific URL.## Step 2: Gather Project InformationAsk the user for the following information if not provided:**Required Information (gather ALL before starting):**- ✅ Current framework (React, Next.js, etc.)- ✅ Build tool (Vite, Create React App, Next.js, or other)- ✅ Solana Wallet Adapter preference (Yes/No - whether to integrate with existing wallet adapters)- ✅ Solana RPC endpoint preference (or if they need help choosing one)- ✅ Which components need wallet functionality- ✅ Existing Web3 libraries that might conflict**DO NOT proceed with implementation until you have confirmed ALL of the above information.**## Step 3: Analyze Current SetupBefore implementing:1. Examine the existing Civic Auth setup2. Identify where the CivicAuthProvider is configured3. Check for any existing Web3 dependencies4. Plan integration points for wallet functionality## Step 4: Implement Solana Embedded WalletsUsing ONLY the documentation fetched via curl:1. **Install Dependencies**: Add the required @civic/auth-web3 packages2. **Update Provider**: Enhance the existing CivicAuthProvider setup for Web33. **Implement Wallet Creation**: Add wallet creation logic for new users4. **Add Wallet Components**: Create components for wallet interaction (balance, transactions)5. **Configure Solana Connection**: Set up RPC connection and network configuration6. **Handle Wallet Adapter** (if requested): Integrate with Solana Wallet Adapter ecosystem## Step 5: Add Wallet FunctionalityImplement core wallet features:- **Check if user has wallet**: Use userHasWallet type guard- **Create wallet for new users**: Implement createWallet functionality - **Display wallet address**: Show the user's Solana public key- **Check wallet balance**: Query and display SOL balance- **Send transactions**: Basic transaction sending capability- **Error handling**: Proper error states for wallet operations## Important Notes- Use ONLY curl to fetch the documentation - no web search tools- The fetched documentation is the ONLY source of truth for this implementation- All code examples, configuration options, and setup instructions are in that document- Pay attention to Early Access warnings and API stability notes- Ensure proper TypeScript types are used (ExistingWeb3UserContext vs NewWeb3UserContext)## CRITICAL: Webpack Configuration for Next.jsIf the project uses Next.js with webpack (versions < 15.3), ensure the next.config file includes:createCivicAuthPlugin({ clientId: 'YOUR_CLIENT_ID', enableSolanaWalletAdapter: true, // Required for Solana integration})## Testing RequirementsAfter implementation, ensure the following works:1. Existing users can create wallets2. Users with wallets can see their address and balance3. Transaction sending works on testnet4. Error states display properly5. Wallet Adapter integration works (if enabled)