Why You Need This
Vercel’s serverless environment cannot run bundled Chromium binaries due to:- Filesystem constraints: Functions are read-only and ephemeral
- Size limits: 50MB max; Chromium is ~300MB
- Memory limits: 1GB (Hobby), 3GB (Pro); Chromium needs 1-2GB
- Timeout limits: 10s (Hobby), 60s (Pro); cold start + page load often exceeds this
Quick Start (Manual Setup)
If you want to get started without installing the marketplace integration:1. Install Dependencies
2. Get API Key
- Sign up at dashboard.onkernel.com
- Go to Settings → API Keys
- Create new API key
3. Add to Vercel
4. Create API Route
5. Test Locally
6. Deploy
Native Integration (Recommended)
For seamless setup and automatic QA checks:1. Install from Marketplace
Visit vercel.com/integrations/kernel and click Add Integration.2. Connect Projects
Select which Vercel projects should have access to Kernel.3. API Key Auto-Provisioned
Kernel automatically addsKERNEL_API_KEY
to your selected projects’ environment variables. No manual setup needed.
4. QA Deployment Checks Enabled
Every preview and production deployment automatically runs QA checks using Kernel’s web agents. See QA Deployment Checks below.QA Deployment Checks
The native integration runs automated QA tests on every deployment using Kernel’s AI web agents:How It Works
- deployment.created: Kernel receives webhook from Vercel
- Check registered: Kernel creates a blocking deployment check
- Agent runs: Web agent navigates your preview URL, tests functionality
- Results posted: Pass/fail status appears in Vercel dashboard
- Deployment proceeds: If passing, deployment continues; if failing, you’re notified
What Gets Tested
Configure checks via Vercel dashboard (Integration Settings → Kernel):- Visual regression: Screenshot comparison vs baseline
- Broken links: Crawl and verify all internal links load
- Auth flows: Test login, signup, password reset
- Critical paths: Custom scripts for checkout, forms, etc.
- Accessibility: WCAG compliance checks
- Performance: Lighthouse scores, load times
Example: Visual Regression
Configure in Vercel Dashboard
- Go to your Vercel project
- Settings → Integrations → Kernel
- Enable checks: Visual Regression, Broken Links, etc.
- Set baseline URLs and thresholds
- Save
Manual Invocation
You can also trigger checks manually via API:Environment-Based Toggle
Use local Playwright in development, Kernel in production:Vercel Limits & How Kernel Handles Them
Limit | Hobby | Pro | How Kernel Helps |
---|---|---|---|
Function timeout | 10s | 60s | Browser pre-warmed, connect in <1s |
Memory | 1GB | 3GB | Browser runs remotely, function uses <100MB |
Deployment size | 50MB | 50MB | No Chromium binaries to deploy |
Cold start | Slow | Slow | Kernel pools browsers, instant connect |
Network Interception
Block resources to speed up page loads:File Downloads
Download files from the browser and upload to S3, R2, etc.:Persistent Sessions
Reuse browser sessions across multiple requests to preserve auth:Migration from Browserless/Browserbase
If you’re switching from another hosted browser provider:From Browserless
From Browserbase
Troubleshooting
Error: “KERNEL_API_KEY is not set”
Add API key to Vercel environment variables:Error: “Timeout connecting to browser”
Check:- API key is valid (test with
kernel.browsers.list()
) - Network allows outbound WebSocket connections
- Vercel function timeout is sufficient (increase if needed)
Error: “Cannot find module ‘playwright-core’”
Make sure you’re usingplaywright-core
(not playwright
) in package.json:
Slow cold starts
Use persistent sessions to reuse browsers across requests. First request creates browser (~2s), subsequent requests connect instantly (~0.1s).Out of memory errors
Use headless mode (headless: true
) and block unnecessary resources. This reduces memory usage from 2GB to <500MB.
Examples
Generate OG Images
Scrape Competitor Prices
Run E2E Tests on Preview
Related Resources
- Playwright Vercel Error
- Headless Chrome on Serverless
- Network Interception
- Playwright Timeouts
- Create a Browser
- File I/O
- Persistence
- Stealth Mode
Support
- Discord: discord.gg/FBrveQRcud
- Email: support@onkernel.com
- GitHub: github.com/onkernel
Starter Template
Clone our Vercel + Kernel starter:- Next.js App Router
- Playwright + Kernel setup
- Example API routes (screenshot, scrape, test)
- Environment variables configured
- TypeScript, ESLint, Prettier