🔑 API Key Setup Guide - Aman ga?
This guide shows you how to get all required API keys for the Aman ga? POC.
📋 Required vs Optional Services
| Service |
Status |
Purpose |
Cost |
| Supabase |
✅ REQUIRED |
Database & Auth |
Free tier available |
| WhatsApp API |
⚠️ OPTIONAL |
User notifications |
Free tier available |
| SendGrid |
⚠️ OPTIONAL |
Email notifications |
Free tier (100/day) |
1️⃣ SUPABASE (REQUIRED)
What it’s used for:
- User database
- Payment records
- Service credits
- Fraud flags
- Admin audit logs
How to get credentials:
Step 1: Create Account
- Go to https://supabase.com
- Click “Start your project” or “Sign Up”
- Sign up with GitHub or email
Step 2: Create Project
- Click “New Project”
- Fill in:
- Name:
aman-ga (or any name)
- Database Password: Choose a strong password (save it!)
- Region: Choose closest to you
- Click “Create new project”
- Wait 2-3 minutes for setup
Step 3: Get API Credentials
- Click Settings (gear icon) in left sidebar
- Click API
- Copy these values:
- Project URL:
https://xxxxx.supabase.co
- anon/public key:
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...
Step 4: Run Database Schema
- Click SQL Editor in left sidebar
- Click New Query
- Copy entire contents of
database/schema.sql
- Paste into SQL Editor
- Click Run (or press Cmd/Ctrl + Enter)
- You should see “Success. No rows returned”
Step 5: Verify Setup
- Click Table Editor in left sidebar
- You should see these tables:
users
payment_proofs
service_credits
fraud_flags
admin_audit_log
Add to .env:
SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.your-anon-key
2️⃣ WHATSAPP API (OPTIONAL)
What it’s used for:
- Payment confirmation notifications
- Account status alerts
- Admin notifications
Option A: Fonnte (Indonesia - Recommended)
Step 1: Create Account
- Go to https://fonnte.com
- Click “Daftar” (Register)
- Fill in your details
Step 2: Get API Token
- Login to https://fonnte.com/dashboard
- Click menu API → API Key
- Copy your API token
Step 3: Activate Device
- Click Add Device
- Scan QR code with your WhatsApp
- Wait for connection
Step 4: Get API URL
- Base URL:
https://api.fonnte.com/send
Add to .env:
WHATSAPP_API_KEY=your-fonnte-token
WHATSAPP_API_URL=https://api.fonnte.com/send
Option B: Twilio (International)
Step 1: Create Account
- Go to https://www.twilio.com
- Click “Sign Up”
- Verify email and phone
Step 2: Get Credentials
- Go to Console Dashboard
- Copy Account SID and Auth Token
Step 3: Setup WhatsApp Sandbox
- Go to Messaging → Try it out → Send a WhatsApp message
- Follow instructions to connect your WhatsApp
- Copy the sandbox number
Add to .env (Twilio):
TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxx
TWILIO_AUTH_TOKEN=your-auth-token
TWILIO_WHATSAPP_NUMBER=whatsapp:+14155238886
3️⃣ SENDGRID (OPTIONAL)
What it’s used for:
- Payment confirmation emails
- Password reset emails
- Admin notifications
Step 1: Create Account
- Go to https://sendgrid.com
- Click “Sign Up Free”
- Complete registration
Step 2: Verify Email
- Check your email
- Click verification link
- Complete account setup
Step 3: Create API Key
- Go to Settings → API Keys
- Click Create API Key
- Name:
Aman ga?
- Permissions: Full Access (or Restricted Access → Mail Send)
- Click Create & View
- Copy the API key immediately (won’t show again!)
Step 4: Verify Sender
- Go to Settings → Sender Authentication
- Click Verify a Single Sender
- Fill in:
- From Email:
noreply@amanga.id (or your email)
- From Name:
Aman ga?
- Reply-To: your email
- Click verification link sent to your email
Add to .env:
SENDGRID_API_KEY=SG.xxxxxxxxxxxxx.your-sendgrid-api-key
SENDGRID_FROM_EMAIL=noreply@amanga.id
SENDGRID_FROM_NAME=Aman ga?
📝 Complete .env File
Copy this to backend/.env:
# ============ SUPABASE (REQUIRED) ============
SUPABASE_URL=https://your-project-id.supabase.co
SUPABASE_KEY=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.your-key
# ============ JWT Security ============
SECRET_KEY=your-super-secret-jwt-key-min-32-chars
ALGORITHM=HS256
ACCESS_TOKEN_EXPIRE_MINUTES=30
# ============ WHATSAPP (OPTIONAL - Leave empty for mock mode) ============
WHATSAPP_API_KEY=
WHATSAPP_API_URL=
# ============ EMAIL (OPTIONAL - Leave empty for mock mode) ============
SENDGRID_API_KEY=
SENDGRID_FROM_EMAIL=noreply@amanga.id
SENDGRID_FROM_NAME=Aman ga?
🧪 Testing Without API Keys
The POC works without WhatsApp and SendGrid!
- If
WHATSAPP_API_KEY is empty → Logs to console instead of sending
- If
SENDGRID_API_KEY is empty → Logs to console instead of sending
This is perfect for development and testing.
✅ Verification Checklist
Supabase
WhatsApp (Optional)
SendGrid (Optional)
🚀 Quick Test
After setting up Supabase:
cd backend
source venv/bin/activate
uvicorn main:app --reload --port 8000
Visit http://localhost:8000/docs to see all API endpoints!
📞 Support
If you get stuck:
- Check Supabase logs: https://app.supabase.com/project/_/logs
- Check backend console for error messages
- Verify your API keys are correct (no extra spaces)