Skip to content

browser-session v0.1.0

Latest

Choose a tag to compare

@jpoindexter jpoindexter released this 14 Jun 09:50

Reuse your real logged-in browser session from Node — no extension export, no manual cookie paste.

  • Cookies (zero deps): read + AES-128-CBC-decrypt your Brave/Chrome/Edge cookies via the macOS Keychain key. The Node equivalent of yt-dlp's --cookies-from-browser. Handles the v10/v11 prefix and the 32-byte SHA256(host) prefix newer Chromium prepends.
  • Session (Playwright, optional): open any login-walled / JS-rendered page in a headless browser with that session injected, return the rendered text + the requests the page made.
npm install browser-session
browser-session read https://www.reddit.com/ --browser brave   # renders YOUR logged-in feed
import { getCookies, readPage } from "browser-session";
getCookies({ browser: "brave", domain: "x.com" });   // { ok, cookie }
await readPage("https://x.com/i/bookmarks", { browser: "brave" });

macOS for the cookie auto-read (one Keychain approval); headless read is cross-platform. MIT. Errors-as-values, never throws. Use a dedicated account for scraping.