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

@clientpad/sdk

v0.2.0

Published

TypeScript SDK for ClientPad public APIs.

Downloads

141

Readme

ClientPad SDK

TypeScript SDK for ClientPad's public API.

Install

pnpm add @clientpad/sdk

Basic Usage

Expose APIs with @clientpad/server, then consume them with this SDK.

import { ClientPad } from "@clientpad/sdk";

const clientpad = new ClientPad({
  baseUrl: "https://example.com/api/public/v1",
  apiKey: process.env.CLIENTPAD_API_KEY!,
});

await clientpad.leads.create({
  name: "Ada Customer",
  phone: "08031234567",
  source: "WhatsApp",
});

WhatsApp Inbox

The whatsapp resource manages live owner approval workflows.

// List conversations
const conversations = await clientpad.whatsapp.list({ status: "open" });

// Get chronological thread
const messages = await clientpad.whatsapp.messages(conversations.data[0].id);

// Fetch AI-suggested replies
const suggestions = await clientpad.whatsapp.suggestions(conversations.data[0].id);

// Approve and send an AI suggestion
await clientpad.whatsapp.approveSuggestion(conversations.data[0].id, {
  suggestion_index: 0,
  send: true,
});

// Send a manual reply and move pipeline stage
await clientpad.whatsapp.reply(conversations.data[0].id, {
  message_text: "Checking availability now.",
  send: true,
  pipeline_stage: "in_progress",
});

Upsert Leads

await clientpad.leads.upsert({
  name: "Ada Customer",
  phone: "08031234567",
  source: "WhatsApp",
});

leads.upsert requires the public API /leads/upsert endpoint and matches records by (workspace_id, phone).

Node

const leads = await clientpad.leads.list({
  limit: 50,
  offset: 0,
  status: "new",
});

Next.js Route Handler

import { ClientPad } from "@clientpad/sdk";

const clientpad = new ClientPad({
  baseUrl: process.env.CLIENTPAD_API_URL!,
  apiKey: process.env.CLIENTPAD_API_KEY!,
});

export async function POST() {
  const result = await clientpad.clients.create({
    business_name: "Ada Ventures",
    primary_contact: "Ada Customer",
  });

  return Response.json(result);
}

Express

app.post("/lead", async (_req, res, next) => {
  try {
    const result = await clientpad.leads.create({
      name: "Ada Customer",
      phone: "08031234567",
    });
    res.json(result);
  } catch (error) {
    next(error);
  }
});

Usage

Hosted ClientPad Cloud keys can expose quota and rate-limit usage:

const usage = await clientpad.usage.retrieve();

console.log(usage.data.request_count);
console.log(usage.data.remaining_requests);

Error Handling

import { ClientPadError } from "@clientpad/sdk";

try {
  await clientpad.leads.list();
} catch (error) {
  if (error instanceof ClientPadError) {
    console.error(error.status, error.payload);
  }
}

Custom Fetch

const clientpad = new ClientPad({
  baseUrl: "https://example.com/api/public/v1",
  apiKey: "cp_test_...",
  fetch: customFetch,
});