cookie-sync
Sync cookies from local Chrome to a Browserbase persistent context so the browse CLI can access authenticated sites. Use when the user wants to browse as themselves, sync cookies, or log into sites via Browserbase.
Security Assessment
Detected risks:
About cookie-sync
The cookie-sync skill solves the challenge of accessing authenticated websites through Browserbase cloud sessions by seamlessly transferring your local Chrome browser cookies to a persistent Browserbase context. When you need to automate tasks on sites where you're already logged in—like Gmail, Twitter, or internal tools—manually re-authenticating in cloud sessions is tedious and sometimes impossible. This skill exports your active Chrome session cookies and injects them into a Browserbase persistent context, allowing the browse CLI to interact with those sites as if you were logged in.
Key features include domain filtering to sync only the cookies you need (avoiding unnecessary data transfer), context reuse to refresh expired cookies without creating new contexts, and advanced options like verified browser mode and residential proxy support. The skill connects to Chrome via the Chrome DevTools Protocol (CDP), extracts cookies, and uses the Browserbase API to create or update persistent contexts. It supports all Chromium-based browsers including Brave and Edge, requires Chrome's remote debugging to be enabled, and works with Node.js 22+.
This skill is designed for developers and automation engineers who need to run authenticated browser sessions in cloud environments for testing, monitoring, data collection, or scheduled tasks. Common use cases include accessing authenticated APIs through browser sessions, running automated workflows on sites that require login, testing user-specific features in cloud CI/CD pipelines, and maintaining long-running scheduled jobs that interact with authenticated web services. By separating the one-time cookie sync (done on your laptop) from the recurring automated tasks (run in Browserbase), you can build robust, authenticated automation without storing credentials or managing complex login flows.
FAQ
Which browsers are supported for cookie syncing?
Chrome, Chromium, Brave, and Edge are supported. You need to enable remote debugging by either enabling the chrome://flags/#allow-remote-debugging flag or launching with --remote-debugging-port=9222. At least one browser tab must be open during sync.
How do I refresh cookies in an existing context?
Use the --context flag with your existing context ID: node cookie-sync.mjs --context ctx_abc123. This re-injects fresh cookies without creating a new context, useful when your session cookies have expired.
What is the difference between verified browser mode and residential proxy?
Verified browser mode (--verified) enables Browserbase Identity to improve browser fingerprinting and access protected sites like Google. Residential proxy (--proxy) routes traffic through a specific geographic location to match your local IP's region, preventing auth cookies from being rejected due to location mismatch. You can combine both for maximum compatibility.
How do I persist new cookies created during a cloud browsing session?
Use the --persist flag when creating the Browserbase session with browse cloud sessions create. This saves any new cookies or state changes back to the context when the session is released, keeping your authentication fresh for future sessions.
Can I use this for scheduled or recurring automated tasks?
Yes. Run cookie-sync once on your laptop to create a persistent context, then use that context ID in your scheduled jobs. The context persists across sessions, so you don't need to re-sync cookies unless they expire or you need to refresh authentication.
Install cookie-sync
Quick Setup:
- Copy the skill folder to
.claude/skills/ - Claude will automatically detect and use the skill
Repository
browserbase/skills