Admin Guide
Quick reference for managing users, credits, and packages.
Accessing Admin Console
- Navigate to
/admin - Must have
role = 'admin'in your profile
To make yourself an admin (run in Supabase SQL editor):
UPDATE profiles SET role = 'admin' WHERE email = 'your@email.com';Dashboard Overview
The Overview tab shows:
- Total Users: All registered accounts
- Credits in Circulation: Sum of all user balances
- Purchased Today: Credits bought via Stripe today
- Used Today: Credits consumed by conversions today
Managing Users
Finding Users
- Use the search box to find by email or name
- Results paginated at 20 per page
Changing Roles
- Click the role dropdown next to any user
- Select “user” or “admin”
- Cannot demote yourself
Credit Operations
Click + Credits to grant free credits:
- Enter amount and optional reason
- Good for: trials, promotions, compensation
Click Adjust for corrections:
- Requires a reason
- Can be positive or negative
- Good for: billing corrections, manual fixes
Managing Packages
The Packages tab shows all credit bundles:
- Active: Toggle to enable/disable for purchase
- Featured: Gets “Most Popular” badge
- Pricing shows per-package and per-credit cost
Default packages:
| Name | Credits | Price | Per Credit |
|---|---|---|---|
| Starter | 50 | $9.99 | $0.20 |
| Standard | 200 | $29.99 | $0.15 |
| Professional | 500 | $59.99 | $0.12 |
| Enterprise | 2000 | $199.99 | $0.10 |
Custom Pricing
To give a user special pricing:
# Via APIcurl -X PUT /api/admin/users/{userId}/pricing \ -H "Authorization: Bearer $TOKEN" \ -d '{"discountPercent": 25}'Or use the database directly:
INSERT INTO customer_pricing (user_id, discount_percent, notes)VALUES ('user-uuid', 25, 'Enterprise contract');Options:
discount_percent: % off all packages (e.g., 25 = 25% off)price_per_credit_cents: Fixed per-credit price
Common Tasks
Refund a User
- Go to Users → Find user
- Click Adjust
- Enter positive amount (e.g., 10 to add 10 credits back)
- Reason: “Refund for [issue]“
Disable a Package
- Go to Packages
- Click the “Active” button to toggle off
- Package won’t appear in purchase options
Check User History
- Go to Users → Click user row
- View full transaction history
- See custom pricing if set
Handle Payment Disputes
- Check Stripe Dashboard for dispute details
- If legitimate:
- Find user in admin
- Use Adjust to deduct disputed credits
- Reason: “Stripe dispute [ID]“
Monitoring
Low Balance Alerts
Currently manual. Check:
- Conversion failures with “INSUFFICIENT_CREDITS”
- Users with balance = 0 who recently used credits
Revenue Tracking
Use Stripe Dashboard for:
- Daily/weekly/monthly revenue
- Refunds and disputes
- Customer lifetime value
Security Notes
- Admin routes require valid JWT + admin role
- All credit operations are logged with
created_by - Cannot delete transaction history (audit trail)
- Stripe webhook verifies signature
Troubleshooting
”User not found”
- UUID format issue or user deleted
- Check profiles table directly
Credits not added after purchase
- Check Stripe webhook logs
- Verify STRIPE_WEBHOOK_SECRET is correct
- Look for errors in worker logs
User can’t purchase
- Check if packages are active
- Verify Stripe keys are configured
- Test in Stripe test mode first