I've just released BrowserState, an open-source TypeScript/JavaScript library that provides persistent memory for browser automation stacks. It lets you seamlessly persist and share browser sessions across local storage, Redis, AWS S3, and Google Cloud Storage. It's immediately compatible with popular automation tools like Playwright, Puppeteer, Selenium, and AI browser agents that expose userDataDir.
Why I built BrowserState:
I've been doing browser automation for over 7 years, starting during the YC batch of 2019 when tooling was minimal and learning often meant hitting painful roadblocks. Sessions frequently broke, authentication was fragile, and bot detection was relentless. Now that browser automation is widespread, I wanted to tackle one of the biggest recurring issues: reliably preserving browser states across runs and environments.
How BrowserState helps:
Persistent Sessions: Fully restore browser contexts including cookies, local storage, IndexedDB, service worker caches, and extensions.
Easy Onboarding: Zero setup—just mount your state and automate immediately.
Scalable & Portable: Easily share sessions across servers, local development, and cloud infrastructure without vendor lock-in.
The Redis backend just launched and is stable for production use. AWS S3 and Google Cloud Storage are also stable, but I'd love your feedback from real-world applications.
// mount user session
const userDataDir = await browserState.mount('session123');
// Use with any browser automation framework
// Example with Playwright:
const browser = await chromium.launchPersistentContext(userDataDir, {
headless: false
});
// When you're done, save changes
await browser.close();
// Save changes back to Redis, GCS, etc
await browserState.unmount();
BrowserState is fully open-source (MIT licensed), immediately usable, and requires no signup.
Links:
NPM: https://www.npmjs.com/package/browserstate
GitHub: https://github.com/browserstate-org/browserstate
Feel free to ask questions or share your feedback!
Hey HN,
I've just released BrowserState, an open-source TypeScript/JavaScript library that provides persistent memory for browser automation stacks. It lets you seamlessly persist and share browser sessions across local storage, Redis, AWS S3, and Google Cloud Storage. It's immediately compatible with popular automation tools like Playwright, Puppeteer, Selenium, and AI browser agents that expose userDataDir.
Why I built BrowserState: I've been doing browser automation for over 7 years, starting during the YC batch of 2019 when tooling was minimal and learning often meant hitting painful roadblocks. Sessions frequently broke, authentication was fragile, and bot detection was relentless. Now that browser automation is widespread, I wanted to tackle one of the biggest recurring issues: reliably preserving browser states across runs and environments.
How BrowserState helps:
Persistent Sessions: Fully restore browser contexts including cookies, local storage, IndexedDB, service worker caches, and extensions.
Bot Detection Bypass: Maintain consistent fingerprints and browser identities, drastically reducing bot detection risks.
Easy Onboarding: Zero setup—just mount your state and automate immediately.
Scalable & Portable: Easily share sessions across servers, local development, and cloud infrastructure without vendor lock-in.
The Redis backend just launched and is stable for production use. AWS S3 and Google Cloud Storage are also stable, but I'd love your feedback from real-world applications.
Quick start:
npm install browserstate
Example (Redis):
import { BrowserState } from 'browserstate';
const browserState = new BrowserState({ userId: 'user123', storageType: 'redis', redisOptions: { host: 'localhost', port: 6379 } });
// mount user session const userDataDir = await browserState.mount('session123');
// Use with any browser automation framework // Example with Playwright: const browser = await chromium.launchPersistentContext(userDataDir, { headless: false });
// When you're done, save changes await browser.close();
// Save changes back to Redis, GCS, etc await browserState.unmount();
BrowserState is fully open-source (MIT licensed), immediately usable, and requires no signup.
GitHub: https://github.com/browserstate/browserstate
I'd appreciate your feedback, questions, and suggestions—thanks!