npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@keystrokehq/browserbase

v0.0.15

Published

Browserbase cloud-browser automation for Keystroke, powered by [Stagehand](https://github.com/browserbase/stagehand).

Readme

@keystrokehq/browserbase

Browserbase cloud-browser automation for Keystroke, powered by Stagehand.

What's in here

  • Cross-step Stagehand ops (navigate, act, observe, extract, screenshot) that thread an optional sessionId so multiple workflow steps can drive the same cloud session.
  • withSession(creds, opts, handler) for running many actions against one session inside a single op.
  • Browserbase-specific extras: session lifecycle (createSession, getLiveView), persistent contexts (createContext, getContext, deleteContext), and direct fetchUrl.
  • createBrowserLoginExchange — a credentials-exchange preset for providers with no API-login endpoint.

createBrowserLoginExchange — browser-login preset

Use this preset when the only way to log into a provider is through a real browser (SSO portals, legacy admin consoles, sites with no API).

import {
  createBrowserLoginExchange,
  type BrowserbaseCredentials,
} from '@keystrokehq/browserbase';
import { CredentialSet } from '@keystrokehq/core';
import { z } from 'zod';

async function resolveBrowserbaseCredentials(): Promise<BrowserbaseCredentials> {
  // Platform-owned Browserbase credentials. In production this comes from
  // the Keystroke-internal provider-app credential set for Browserbase.
  return { BROWSERBASE_API_KEY: process.env.BROWSERBASE_API_KEY ?? '' };
}

export const legacyPortal = new CredentialSet({
  id: 'legacyPortal',
  auth: z.object({ sessionCookie: z.string() }),
  stored: z.object({
    sessionCookie: z.string(),
    cookieName: z.string(),
    cookieDomain: z.string(),
    browserbaseContextId: z.string(),
  }),
  resolve: async (stored) => ({ sessionCookie: stored.sessionCookie }),
  connection: createBrowserLoginExchange({
    input: z.object({
      username: z.email(),
      password: z.string().min(1),
    }),
    stored: z.object({
      sessionCookie: z.string(),
      cookieName: z.string(),
      cookieDomain: z.string(),
      browserbaseContextId: z.string(),
    }),
    loginUrl: 'https://portal.example.com/login',
    fields: {
      username: 'Type %username% into the email field',
      password: 'Type %password% into the password field',
    },
    submit: 'Click the Sign in button',
    successSignal: { waitForUrl: /\/dashboard/ },
    cookie: { name: 'example_session', domain: 'portal.example.com' },
    resolveBrowserbaseCredentials,
  }),
});

Security posture

  • The LLM never sees plaintext credentials. Each field instruction references its value via %fieldName%; Stagehand substitutes the placeholder at Chromium level after the LLM generates the click/type plan.
  • The exchange and rotate hooks run host-side in the trusted runtime. User step code never observes the raw input, the Stagehand session, or the extracted cookie — only the resolved auth value returned by resolve.
  • Workspace-authored browser-login is out of scope in v1. The preset is intended for Keystroke-official integrations only. Adding a workspace-facing variant requires a trust-model extension beyond cluster 11.

Rotation

Rotate reconnects the persistent Browserbase context and probes a known authenticated URL. A redirect back to the login URL signals the session is dead and the preset returns 'needs-reinput'. Keep the rotate tolerance conservative — every rotate spawns a Browserbase session, and the scheduler runs ahead of expiresAt to give the new cookie time to land before the old one expires in flight.

See plans-reconciled/14-credentials-exchange-connection-kind/03-browser-preset-docs.md for the full design and testing notes.