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

@pocketenv/sdk

v0.2.10

Published

Official JavaScript/TypeScript SDK for the Pocketenv API

Readme

@pocketenv/sdk

npm version NPM Downloads discord ci

Official JavaScript/TypeScript SDK for Pocketenv.

Installation

npm install @pocketenv/sdk
# or
bun add @pocketenv/sdk

Authentication

The SDK resolves your API token from the first available source:

  1. Passed explicitly to Sandbox.configure({ token }) or Sandbox.create({ token })
  2. POCKETENV_TOKEN environment variable
  3. ~/.pocketenv/token.json — a JSON file with the shape { "token": "tok_..." }

This means Sandbox.configure() is optional if you have a token file or environment variable set.

Quick Start

import { Sandbox } from "@pocketenv/sdk";

// No configuration needed if ~/.pocketenv/token.json or POCKETENV_TOKEN is set
const sandbox = await Sandbox.create({ base: "openclaw" });

// Run a command
const result = await sandbox.sh`echo hello`;
console.log(result.stdout); // "hello\n"

// With interpolation
const dir = "/home/user";
const files = await sandbox.sh`ls -la ${dir}`;

// Stop and clean up
await sandbox.stop();
await sandbox.delete();

API

Sandbox.configure({ token?, baseUrl? })

Optionally set a global API token (and optional base URL) used by all subsequent calls. If omitted, the SDK falls back to POCKETENV_TOKEN or ~/.pocketenv/token.json.

Sandbox.create(options)

Create a new sandbox. Pass token inline to skip configure().

const sandbox = await Sandbox.create({
  base: "openclaw",
  name: "my-sandbox",
  token: "tok_...",
});

Sandbox.builder(base)

Fluent builder for creating sandboxes — useful when setting many options, especially multiple envs or secrets.

const sandbox = await Sandbox.builder("openclaw")
  .name("my-sandbox")
  .vcpus(4)
  .memory(8192)
  .env("NODE_ENV", "production")
  .env("PORT", "3000")
  .secret("API_KEY", process.env.API_KEY!)
  .keepAlive()
  .create();

Available builder methods: name, description, provider, topics, repo, vcpus, memory, disk, readme, env, secret, keepAlive, token, baseUrl.

Sandbox.get(id)

Fetch an existing sandbox by ID.

Sandbox.list({ limit?, offset? })

List all sandboxes.

Instance methods

| Method | Description | |-----------------------------------------------------|-------------------------------------------------------------------| | sandbox.start({ repo?, keepAlive? }) | Start the sandbox | | sandbox.stop() | Stop the sandbox | | sandbox.delete() | Delete the sandbox | | sandbox.exec(command) | Run a raw command | | sandbox.sh\command` | Run a shell command via/bin/sh -c(tagged template or string) | |sandbox.expose(port, description?) | Expose a port publicly | |sandbox.unexpose(port) | Remove a port exposure | |sandbox.vscode() | Expose VS Code; returns the preview URL | |sandbox.getSshKeys() | Get the sandbox SSH key pair | |sandbox.putSshKey(publicKey, privateKey) | Set an SSH key pair (private key is encrypted automatically) | |sandbox.createBackup(directory, description?, ttl?)| Create a backup of a sandbox directory | |sandbox.listBackups() | List all backups for the sandbox | |Sandbox.restoreBackup(backupId)` (static) | Restore a sandbox from a backup |

Sub-resources

  • sandbox.filewrite, list, get, update, delete
  • sandbox.envput, list, get, update, delete
  • sandbox.secretput, list, get, update, delete
  • sandbox.volumecreate, list, get, update, delete
  • sandbox.portslist
  • sandbox.serviceadd, list, start, stop, restart, update, delete
  • sandbox.tailscalegetAuthKey, setAuthKey
  • sandbox.backupcreate(directory, description?, ttl?), list(), restore(backupId)

Development

bun install
bun test        # run tests
bun run build   # compile to dist/

License

MIT