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

chaser-sdk

v0.2.1

Published

Official TypeScript SDK for the Chaser

Readme

chaser-sdk

Official TypeScript SDK for Chaser.

This SDK targets the following surfaces:

  • sessions
  • workspaces
  • exec
  • command lifecycle
  • files
  • runtime self-tests and preview URLs
  • browser CDP helpers
  • accounts and organizations
  • service accounts and keys
  • billing
  • lifecycle webhooks
  • audit
  • jobs

Installation

npm install chaser-sdk

Quickstart

import { ChaserClient } from 'chaser-sdk';

const client = new ChaserClient({
  apiKey: process.env.CHASER_API_KEY,
  account: 'personal'
});

const workspace = await client.workspaces.create({
  name: 'frontend-app',
  session_type: 'sandbox',
  image: 'ghcr.io/example/dev:latest'
});

const session = await client.sessions.create({
  workspace: workspace.name,
  session_type: 'sandbox'
});

await client.sessions.waitUntilReady(session.id);

const result = await client.exec.inSession(session.id, {
  command: 'node -v && pwd',
  cwd: '/workspace'
});

console.log(result.output);

Stateless exec

const result = await client.exec.run({
  ephemeral: true,
  image: 'node:20-bookworm',
  command: 'npm test',
  cwd: '/workspace'
});

File upload/download

await client.files.uploadText(session.id, '/workspace/hello.txt', 'hello from sdk');
const text = await client.files.downloadText(session.id, '/workspace/hello.txt');

Runtime diagnostics and previews

const diagnostics = await client.sessions.selfTest(session.id);
const previewUrl = client.sessions.forwardUrl(session.id, 3000);
console.log(diagnostics.runtime.tools.node, previewUrl);

Network controls

const session = await client.sessions.create({
  ephemeral: true,
  session_type: 'sandbox',
  proxy: 'socks5h://user:[email protected]:1080'
});

Use the root-level proxy field for the public API contract. The SDK still accepts the older network.proxy.url shape and normalizes it for backward compatibility, but new code should send proxy directly.

Browser CDP helper

const browser = await client.sessions.create({
  session_type: 'browser',
  ephemeral: true
});

const version = await client.browser.version(browser.id);
const cdpUrl = await client.browser.cdpWebSocketUrl(browser.id);
const cdp = await client.browser.connect(browser.id);
console.log(version.Browser, cdpUrl);

await cdp.send('Browser.getVersion');
cdp.close();

Workspace selectors and delete

const workspace = await client.workspaces.create({
  name: 'frontend-app',
  session_type: 'sandbox'
});

// Names are preferred when unambiguous; UUIDs work too.
await client.workspaces.delete(workspace.name, { force: true });

If a workspace name is ambiguous inside the active account, the API returns a workspace_name_ambiguous error and you should use the workspace UUID instead.

Account-scoped automation

const orgClient = client.withAccount('Acme Engineering');

const serviceAccount = await orgClient.accounts.serviceAccounts.create('ci-bot');
const key = await orgClient.accounts.serviceAccounts.keys.create(serviceAccount.id, {
  name: 'ci-key',
  scopes: ['sessions.read', 'workspaces.write', 'exec.write', 'files.read', 'webhooks.write']
});

console.log(key.key);

Command lifecycle

const started = await client.exec.inSession(session.id, {
  command: 'npm run dev',
  cwd: '/workspace',
  background: true
});

if (!started.command_id) {
  throw new Error('expected background command_id');
}

const command = await client.commands.waitForCompletion(session.id, started.command_id, {
  timeoutMs: 30_000
});

console.log(command.status, command.exit_code);

Notes

  • apiKey and token both map to bearer authentication. Either can be used.
  • account maps to the X-Chaser-Account header.
  • File upload/download helpers target sandbox sessions only.
  • client.browser.connect() uses the public CDP endpoint and waits for browser readiness by default.
  • For authenticated upstream proxies, embed credentials in the proxy URL, for example socks5h://user:[email protected]:1080.

Error handling

import { ChaserApiError } from 'chaser-sdk';

try {
  await client.workspaces.delete('frontend-app');
} catch (error) {
  if (error instanceof ChaserApiError) {
    console.error(error.status, error.code, error.rateLimit?.remaining);
  }
  throw error;
}