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

@costkey/replay

v0.1.0

Published

Session replay for browser agents. Records the pages your Playwright or Puppeteer agent drives and lines them up with its LLM calls in CostKey.

Readme

@costkey/replay

Session replay for browser agents. Watch what your agent did on each page, as smooth video, lined up with the LLM call that chose each action and what the run had cost by then.

npm install @costkey/replay
import { CostKey } from "costkey";
import { CostKeyReplay } from "@costkey/replay";
import { chromium } from "playwright";

CostKey.init({ dsn: process.env.COSTKEY_DSN });
await CostKeyReplay.init(); // same DSN, from COSTKEY_DSN

await CostKey.startTrace({ name: "checkout-agent" }, async () => {
  const browser = await chromium.launch();
  const page = await browser.newPage();
  // ...your agent, unchanged
});

Or with no code changes:

COSTKEY_DSN=... node --import @costkey/replay/register agent.js

How it works

There's nothing to wrap. @costkey/replay hooks the Playwright or Puppeteer your app already uses, the same way the costkey SDK hooks fetch:

  • Every Chromium page gets an rrweb recording. The recorder runs on its own CDP session, in an isolated world. The page's scripts can't see it, the page's CSP doesn't apply to it, and the page never makes a request for it. Events come back over CDP and upload in the background.
  • The agent's actions are kept, for example locator.click("#buy"), page.goto(url) or mouse.click(412, 230), with their selectors, URLs and coordinates. Typed text is never kept, only its length. rrweb masks every input field.
  • Images and fonts come from the agent's own browser over CDP. That includes pages behind a login. Each one is uploaded once per project, so a replay never loads anything from the original site.
  • Runs: each page is tied to the CostKey run (trace) its actions happen in. When the same page moves to another run, the recording starts that run from a fresh snapshot.

Privacy

Recording is off until both sides opt in:

  1. Your app calls CostKeyReplay.init() or uses the register hook.
  2. An admin turns on Screen recordings for the project, under Settings → Privacy & data. While it's off, nothing is recorded or sent.

Keep pages out of recordings with URL patterns:

await CostKeyReplay.init({ blockUrls: ["*/billing/*", "https://accounts.example.com/*"] });

The register hook reads the same patterns from COSTKEY_REPLAY_BLOCK_URLS, comma-separated.

Replays follow the project's body retention and are only visible to members who can read captured content.

Safety

The recorder runs inside your agent's process, so:

  • It never makes the agent wait. Copying is cheap and uploads happen in the background, with bounded memory.
  • Any unexpected error switches recording off for the rest of the process, logs one warning and leaves the agent alone.
  • If the server says recordings are off, or the DSN is wrong, it stops for good.

Call await CostKeyReplay.flush() before a short-lived script exits.

Supported

| | | |---|---| | Playwright (Node) | 1.40 and later, Chromium (launch, launchPersistentContext, connectOverCDP) | | Puppeteer | 22 and later (launch, connect) | | Node | 20 and later |

Not yet: Playwright from Python, Java or .NET, Firefox and WebKit, and desktop (VNC) recording.

Options

| Option | Default | | |---|---|---| | dsn | COSTKEY_DSN | Your project's DSN | | blockUrls | [] | URL globs never recorded | | debug | false | Log what the recorder skips |