Never commit API keys to version control. Always use environment variables.
Step 3: Configure Environment Variables
Create a .env.local file in your project root:
# CoinFlow Sandbox ConfigurationCOINFLOW_MERCHANT_ID=your_sandbox_merchant_idCOINFLOW_API_KEY=your_sandbox_api_keyCOINFLOW_WEBHOOK_SECRET=your_sandbox_webhook_secretCOINFLOW_ENV=sandbox# Public keys for client-sideNEXT_PUBLIC_COINFLOW_ENV=sandboxNEXT_PUBLIC_COINFLOW_MERCHANT_ID=your_sandbox_merchant_id
Step 4: Install Dependencies
Install the CoinFlow React SDK:
npm install @coinflowlabs/react
Or with yarn:
yarn add @coinflowlabs/react
Step 5: Create Payment Component
Create a new component components/CoinflowPayment.tsx: