Labsco
browserbase logo

cookie-sync

✓ Official3,600

by browserbase · part of browserbase/skills

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…

🔥🔥🔥✓ VerifiedAccount requiredNeeds API keys
🧩 One of 7 skills in the browserbase/skills package — works on its own, and pairs well with its siblings.

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…

Inspect the full instructions your agent will receiveExpand

This is the exact playbook injected into your agent when the skill activates — shown here so you can audit it before installing. You don't need to read it to use the skill.

by browserbase

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… npx skills add https://github.com/browserbase/skills --skill cookie-sync Download ZIPGitHub3.6k

Cookie Sync — Local Chrome → Browserbase Context

Exports cookies from your local Chrome and saves them into a Browserbase persistent context. After syncing, use the browse CLI to open authenticated sessions with that context.

Supports domain filtering (only sync cookies you need) and context reuse (refresh cookies without creating a new context).

Browsing Authenticated Sites

After syncing, use the browse CLI with the context ID:

Copy & paste — that's it
SESSION_JSON="$(browse cloud sessions create --context-id --persist --keep-alive)"
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"

browse open https://mail.google.com --cdp "$CONNECT_URL"

The --persist flag on browse cloud sessions create saves any new cookies or state changes back to the context when the cloud session is released, keeping the session fresh for next time.

Full workflow example:

Copy & paste — that's it
# Step 1: Sync cookies for Twitter
node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains x.com,twitter.com
# Output: Context ID: ctx_abc123

# Step 2: Browse authenticated Twitter
SESSION_JSON="$(browse cloud sessions create --context-id ctx_abc123 --persist --keep-alive)"
SESSION_ID="$(echo "$SESSION_JSON" | jq -r .id)"
CONNECT_URL="$(echo "$SESSION_JSON" | jq -r .connectUrl)"

browse open https://x.com/messages --cdp "$CONNECT_URL"
browse snapshot
browse screenshot
browse stop
browse cloud sessions update "$SESSION_ID" --status REQUEST_RELEASE

Reusing Contexts for Scheduled Jobs

Contexts persist across sessions, making them ideal for scheduled/recurring tasks:

  • Once (laptop open): Run cookie-sync → get a context ID

  • Scheduled jobs: Create a Browserbase session with browse cloud sessions create --context-id <ctx-id> --persist --keep-alive, then attach with browse open <url> --cdp <connectUrl> — no local Chrome needed

  • Re-sync as needed: When cookies expire, run cookie-sync again with --context <ctx-id> to refresh