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

@panda-ai/claw-sdk

v0.1.0

Published

Pure TypeScript SDK for standard OpenClaw gateway API calls

Readme

Claw SDK

Pure TypeScript SDK for standard OpenClaw gateway API calls.

claw-sdk wraps OpenClaw chat and tool endpoints into an agent-oriented API so your app can call stable methods instead of manually building HTTP payloads.

Features

  • Pure TypeScript with full type exports
  • Built-in runtime adapters: OpenClaw and NanoClaw
  • Agent abstraction with auto conversation memory
  • Streaming support (stream + onChunk)
  • One-shot calls (run) that do not affect memory
  • Tool invocation support (agent.use)
  • Multi-agent lifecycle management
  • Typed error hierarchy for gateway failures

Install

pnpm add claw-sdk

Node.js >=18.17 is required.

Quick Start

import { Claw } from "claw-sdk"

const os = new Claw({
  gatewayUrl: "http://localhost:18789",
  token: process.env.CLAW_GATEWAY_TOKEN ?? "your-gateway-token",
  runtime: "openclaw",
  defaultModel: "openclaw",
})

const assistant = os.agent({
  name: "assistant",
  systemPrompt: "You are concise and practical.",
})

const first = await assistant.send("My name is Alex.")
const second = await assistant.send("What is my name?")

console.log(first)
console.log(second)

Streaming

const text = await assistant.send("Write a short haiku about coding.", {
  stream: true,
  onChunk: (chunk) => process.stdout.write(chunk),
})

One-shot Prompt

const summary = await assistant.run("Summarize: TypeScript SDKs improve DX.")

Tool Use

const result = await assistant.use("web-search", { query: "OpenClaw release notes" })

NanoClaw Runtime

const os = new Claw({
  gatewayUrl: "http://localhost:18789",
  token: process.env.CLAW_NANOCLAW_TOKEN ?? "your-nanoclaw-token",
  runtime: "nanoclaw",
  defaultModel: "claude-3-5-sonnet-latest",
})

nanoclaw adapter uses Anthropic-compatible endpoints (/v1/messages, /v1/models). Direct agent.use() tool invocation is currently only supported by the openclaw adapter.

API Overview

const os = new Claw(config)
const agent = os.agent("assistant")

await agent.send("...")
await agent.run("...")
await agent.use("tool-id", { ...params })

agent.reset()
os.close("assistant")
await os.ping()

Errors

  • ClawError: base SDK error
  • GatewayConnectionError: network/connection failure on ping
  • AgentNotFoundError: closing a non-existing agent

Docs

  • Getting started: docs/getting-started.md
  • API reference: docs/api-reference.md
  • OpenClaw test coverage: docs/openclaw-test-coverage.md
  • Examples: docs/examples/*

Development

pnpm install
pnpm typecheck
pnpm lint
pnpm test
pnpm build

Real gateway integration test (optional):

cp .env.real.example .env.real
pnpm test:real

Optional env vars: CLAW_REAL_MODEL, CLAW_REAL_TIMEOUT_MS, CLAW_REAL_TOOL_ID, CLAW_REAL_TOOL_PARAMS_JSON.

License

MIT