A React TypeScript application demonstrating Coinbase CDP (Coinbase Developer Platform) integration with dynamic OAuth authentication and onramp functionality.
- Coinbase CDP Onramp Integration - Direct fiat-to-crypto onramp using Coinbase Pay
- Dynamic OAuth Authentication - Seamless Coinbase wallet connection
- Session Token Management - Secure JWT-based API authentication
- Payment Processing - Credit purchase system with multiple payment methods
- Modern React Frontend - TypeScript, Tailwind CSS, shadcn/ui components
- Node.js 22.12+
- Coinbase Developer Platform account
- Environment variables configured
# Clone the repository
git clone <repository-url>
cd hackathon
# Install dependencies
npm install
# Set up environment variables
cp coinbase.env.example .env
# Edit .env with your CDP credentials
# Start development server
npm run devConfigure these environment variables:
# Coinbase CDP Configuration
CDP_ENV=sandbox
CDP_KEY_ID=ak_sandbox_xxxxx
CDP_KEY_SECRET=your_private_key_here
CDP_DESTINATION_ADDRESS=your_wallet_address
CDP_DESTINATION_NETWORK=base
# Coinbase OAuth Configuration
COINBASE_CLIENT_ID=your_client_id
COINBASE_CLIENT_SECRET=your_client_secret
COINBASE_REDIRECT_URI=http://localhost:3000/auth/callback- Session Token Generation - Creates secure session tokens for Coinbase Pay
- Onramp Functionality - Direct integration with Coinbase onramp services
- Multi-Payment Support - Apple Pay, Google Pay, credit cards, crypto
- Wallet Connection - Connect user's Coinbase wallet
- Token Management - Secure access token handling
- Profile Access - Read user wallet information
coinbase-payment-modal.tsx- Payment interfaceauth-modal-new.tsx- Authentication modalpricing-section.tsx- Credit packages with CDP integration
POST /api/cdp/session-token # Generate CDP session token
POST /api/cdp/onramp # Create onramp transaction
POST /api/oauth/token # OAuth token exchange
GET /api/oauth/profile # Get user profileCDP_SETUP_GUIDE.md- Complete CDP setup instructionsCOINBASE_INTEGRATION.md- Integration overviewCOINBASE_OAUTH_SETUP.md- OAuth configuration guide
# Test CDP integration
npm run test:cdp
# Test OAuth flow
npm run test:oauth
# Run all tests
npm test- Frontend: React 18 + TypeScript + Vite
- Styling: Tailwind CSS + shadcn/ui components
- State Management: React Context + hooks
- Authentication: Coinbase OAuth 2.0
- Payments: Coinbase CDP Onramp
- Fork the repository
- Create a feature branch
- Make your changes
- Test CDP integration
- Submit a pull request
MIT License