Agentic browser automation extension built with Plasmo + Next.js.
zap-demo-post.mp4
- Sidepanel agent console + popup launcher
- Background automation loop (snapshot -> plan -> execute -> verify)
- Confirmation gate for sensitive click actions
- Supabase email/password auth in sidepanel
- Next.js planner APIs backed by OpenRouter (
google/gemini-2.5-flashby default)
- Copy env file:
cp .env.example .env- Add keys in
.env:
OPENROUTER_API_KEYPLASMO_PUBLIC_SUPABASE_URLPLASMO_PUBLIC_SUPABASE_ANON_KEY
For API route verification you can either set:
SUPABASE_URL+SUPABASE_ANON_KEY
or rely on the PLASMO_PUBLIC_SUPABASE_* values.
Also configure Supabase Auth URL settings:
Site URL:http://localhost:1947Redirect URLs:http://localhost:1947/auth/confirmed
If you want Google sign-in in the extension sidepanel:
- Enable the Google auth provider in Supabase.
- Add your extension redirect URL (from
chrome.identity.getRedirectURL()) to Supabase Redirect URLs. - Add the same redirect URL to your Google OAuth client.
- You can find the extension id in
chrome://extensionsand build the URL ashttps://<extension-id>.chromiumapp.org/.
- Install and run:
pnpm install
pnpm devThis runs both:
- Plasmo extension dev server
- Next.js server on
http://localhost:1947
-
Load extension from
build/chrome-mv3-devinchrome://extensions. -
Open the sidepanel and sign in (Google or email/password) before running commands.
src/background/index.ts- core agent loop and action executionsrc/sidepanel/index.tsx- sidepanel command UIsrc/components/agent-console.tsx- shared popup/sidepanel consolesrc/pages/auth/confirmed.tsx- email-confirmation callback pagesrc/pages/api/agent/plan.ts- planner endpointsrc/pages/api/agent/health.ts- health endpoint
- This version is website-automation first (no direct GitHub/Sheets API connectors).
- Planner and run-log APIs require a valid Supabase bearer token.
- Keep
.envprivate. Never commit your OpenRouter or Supabase keys. - Set
PLASMO_PUBLIC_AGENT_SAVE_RUN_LOGS=trueto write run logs into.zap-logs/. - Planner traces now persist the exact LLM input/output for each step at
.zap-logs/<day>/planner-traces/<runId>/step-XX-attempt-YY.json. - Planner API health check:
http://localhost:1947/api/agent/health