A production-ready Screenshot-as-a-Service platform with intelligent cookie consent handling, built for developers.
- 🚀 Fast & Reliable - Efficient browser pool management
- 🔐 Secure Authentication - API key-based auth with bcrypt hashing
- 📊 Usage Analytics - Track requests, quotas, and performance
- 💰 Subscription Plans - Free, Pro, and Enterprise tiers
- ⚡ Rate Limiting - Per-plan rate limits with quota management
- 🪝 Webhooks - Real-time event notifications
- 🛡️ Admin Dashboard - User management and system analytics
- 🍪 Smart Cookie Handling - Automatic cookie consent banner detection
- 📈 Scalable - Built for horizontal scaling
- Node.js 18+
- PostgreSQL database
- Playwright browsers
- Clone the repository:
git clone <repository-url>
cd browser-pool- Install dependencies:
npm install
npx playwright install- Set up environment variables:
cp .env.example .env
# Edit .env with your configuration- Set up the database:
# Create PostgreSQL database
createdb browser_pool
# Run migrations
npx prisma migrate dev
# (Optional) Seed with sample data
npx prisma db seed- Start the development server:
npm run dev- 100 screenshots/month
- 5 requests/minute
- Standard support
- Basic features
- 5,000 screenshots/month
- 30 requests/minute
- Priority support
- Webhook notifications
- 100,000 screenshots/month
- 100 requests/minute
- Dedicated support
- Custom features
- SLA guarantee
Full API documentation is available in docs/API.md.
# Register a new user
curl -X POST http://localhost:3000/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "user@example.com",
"password": "securepass123",
"name": "John Doe"
}'
# Take a screenshot
curl -X POST http://localhost:3000/screenshot \
-H "X-API-Key: your_api_key_here" \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}' \
-o screenshot.pngBrowser Pool uses Dodo Payments for subscription management.
# Create a checkout session
curl -X POST http://localhost:3000/subscriptions/checkout \
-H "X-API-Key: your_api_key" \
-H "Content-Type: application/json" \
-d '{"plan": "PRO", "trialDays": 7}'
# Response includes checkout URL
{
"checkoutUrl": "https://checkout.dodo.com/session/abc123"
}# View current subscription
curl http://localhost:3000/subscriptions \
-H "X-API-Key: your_api_key"
# Upgrade plan
curl -X POST http://localhost:3000/subscriptions/upgrade \
-H "X-API-Key: your_api_key" \
-d '{"plan": "ENTERPRISE"}'
# Cancel subscription
curl -X POST http://localhost:3000/subscriptions/cancel \
-H "X-API-Key: your_api_key"For complete subscription setup and testing guide, see docs/SUBSCRIPTIONS.md.
See docs/SAAS_ARCHITECTURE.md for detailed architecture documentation.
- Runtime: Node.js with TypeScript
- Web Framework: Hono (lightweight & fast)
- Database: PostgreSQL with Prisma ORM
- Browser Automation: Playwright
- Authentication: API key-based with bcrypt
- Logging: Winston
- Payments: Dodo Payments integration
# Application
NODE_ENV=development
PORT=3000
ORIGIN_URL=http://localhost:3000
# Database
DATABASE_URL=postgresql://user:password@localhost:5432/browser_pool
# Authentication
JWT_SECRET=your-secret-key
API_KEY_PREFIX=bp_
# Rate Limiting (requests per minute)
RATE_LIMIT_FREE=5
RATE_LIMIT_PRO=30
RATE_LIMIT_ENTERPRISE=100
# Quotas (requests per month)
QUOTA_FREE=100
QUOTA_PRO=5000
QUOTA_ENTERPRISE=100000
# Dodo Payments
DODO_API_KEY=your-dodo-api-key
DODO_WEBHOOK_SECRET=your-dodo-webhook-secret
# Browser Pool
BROWSER_POOL_SIZE=5
BROWSER_IDLE_TIMEOUT=300000