cookie-sync

작성자: browserbase

로컬 Chrome의 쿠키를 Browserbase 영구 컨텍스트에 동기화하여 browse CLI가 인증된 사이트에 접근할 수 있도록 합니다. 사용자가 다음과 같이 탐색하려는 경우 사용합니다.

npx skills add https://github.com/browserbase/skills --skill cookie-sync

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).

Prerequisites

  • Chrome (or Chromium, Brave, Edge) with remote debugging enabled
  • If your browser build exposes chrome://flags/#allow-remote-debugging, enable it and restart the browser
  • Otherwise, launch with --remote-debugging-port=9222 --user-data-dir=/tmp/chrome-debug and set CDP_URL=ws://127.0.0.1:9222
  • At least one tab open in Chrome
  • Node.js 22+
  • Environment variable: BROWSERBASE_API_KEY

Setup

Install dependencies before first use:

cd .claude/skills/cookie-sync && npm install

Usage

Basic — sync all cookies

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs

Creates a persistent context with all your Chrome cookies. Outputs a context ID.

Filter by domain — only sync specific sites

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains google.com,github.com

Matches the domain and all subdomains (e.g. google.com matches accounts.google.com, mail.google.com, etc.)

Refresh cookies in an existing context

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --context ctx_abc123

Re-injects fresh cookies into a previously created context. Use this when cookies have expired.

Verified browser mode

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --verified

Enables Browserbase Identity with a Verified browser to improve access on protected sites. Recommended for sites like Google that fingerprint browsers.

Residential proxy with geolocation

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --proxy "San Francisco,CA,US"

Routes through a residential proxy in the specified location. Format: "City,ST,Country" (state is 2-letter code). Helps match your local IP's geolocation so auth cookies aren't rejected.

Combine flags

node .claude/skills/cookie-sync/scripts/cookie-sync.mjs --domains github.com,google.com --verified --proxy "San Francisco,CA,US"

Browsing Authenticated Sites

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

SESSION_JSON="$(browse cloud sessions create --context-id <ctx-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:

# 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:

  1. Once (laptop open): Run cookie-sync → get a context ID
  2. 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
  3. Re-sync as needed: When cookies expire, run cookie-sync again with --context <ctx-id> to refresh

Troubleshooting

  • "No DevToolsActivePort found" → Enable chrome://flags/#allow-remote-debugging if your browser build exposes it, or launch with --remote-debugging-port=9222 and set CDP_URL=ws://127.0.0.1:9222
  • "No open page targets found" → Open at least one tab in Chrome
  • "WebSocket error" → Chrome may be hung; force quit and reopen it
  • Cookies expired in context → Re-run cookie-sync with --context <id> to refresh
  • Auth rejected by site → Try adding --verified and/or --proxy with a location near you

browserbase의 다른 스킬

browser-automation
browserbase
MCP 도구를 사용하여 웹 브라우저 상호작용을 자동화합니다. 사용자가 웹사이트 탐색, 웹 페이지 이동, 웹사이트에서 데이터 추출, 스크린샷 촬영 등을 요청할 때 사용하세요.
official
functions
browserbase
서버리스 브라우저 자동화를 공식 Browserbase Functions CLI를 사용하여 배포하는 방법을 안내합니다. 사용자가 자동화를 배포하여 실행하려는 경우 사용하세요.
official
autobrowse
browserbase
자기 개선형 브라우저 자동화로, 자동 연구 루프를 통해 탐색 작업을 반복 실행하고, 추적 기록을 읽으며, 탐색 기술을 개선합니다…
official
browser
browserbase
로컬 Chrome 또는 원격 Browserbase를 사용한 브라우저 자동화로 보호된 사이트, 봇 탐지, CAPTCHA를 처리합니다. 두 가지 모드: 로컬 Chrome(기본, 설정 불필요) 또는 원격 Browserbase(안티봇 스텔스, 자동 CAPTCHA 해결, 리지덴셜 프록시, 세션 유지). 핵심 명령어는 탐색, 페이지 검사, 상호작용(클릭, 입력, 채우기, 선택, 드래그), CLI를 통한 세션 관리를 포함합니다. browse snapshot을 사용하여 접근성 트리를 읽고 신뢰할 수 있는 상호작용을 위한 요소 참조를 얻습니다. 예약...
official
browser-trace
browserbase
모든 브라우저 자동화의 전체 DevTools 프로토콜 추적(CDP 파이어호스, 스크린샷, DOM 덤프)을 캡처한 후, 스트림을 페이지별로 검색 가능하게 분할합니다…
official
browserbase-cli
browserbase
Use the Browserbase CLI (`bb`) for Browserbase Functions and platform API workflows. Use when the user asks to run `bb`, deploy or invoke functions, manage…
official
company-research
browserbase
판매할 기업을 발견하고 심층 조사합니다. Browserbase Search API를 사용하여 기업을 발굴하고, Plan→Research→Synthesize 패턴으로 심층 보강하여 점수가 매겨진 연구 보고서와 CSV를 출력합니다.
official
event-prospecting
browserbase
컨퍼런스 URL을 입력하면, AE가 대화해야 할 사람들의 순위 목록과 각 사람에게 연락해야 하는 이유를 제공합니다.
official