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

@humane-ai/sdk

v0.3.1

Published

Behavioral intelligence for your LLM apps. Every AI should know who it's talking to.

Readme

@humane-ai/sdk

Every AI should know who it's talking to.

TypeScript/JavaScript client for the Humane AI behavioral intelligence platform. Works in Node 18+, Deno, Bun, and modern browsers.

Install

npm i @humane-ai/sdk
# or
pnpm add @humane-ai/sdk

Quick start

import { HumaneClient } from "@humane-ai/sdk";

const client = new HumaneClient({ apiKey: process.env.HUMANE_KEY! });

const r = await client.process({
  userId: "patient_42",
  message: "I'm really struggling with this",
});

console.log(r.response);           // AI response shaped by behavioral context
console.log(r.user.mood);          // 0.28
console.log(r.safety.action);      // "PROCEED" | "HOLD" | "BLOCK"
console.log(r.analysis?.reasons);  // ["'struggling' → sadness (negative)", …]
console.log(r.analysis?.signal_magnitude);  // "normal" | "strong" | "pivot"
console.log(r.analysis?.mood_delta);        // -0.4 — bigger snap signal

// Safety detail when the gate caught something
for (const m of r.safety.matched ?? []) console.log(m.phrase, m.category);
if (r.safety.override) console.log(r.safety.override);  // e.g. "combo_a_force_block"

// A/B experiments assigned for this request
for (const ex of r.experiments ?? []) {
  console.log(ex.experiment_name, "→", ex.variant_name);
}

One-line OpenAI wrap

import OpenAI from "openai";
import { wrap } from "@humane-ai/sdk";

const client = wrap(new OpenAI(), { humaneKey: process.env.HUMANE_KEY! });

const resp = await client.chat.completions.create({
  model: "gpt-4o-mini",
  messages: [{ role: "user", content: "I'm anxious" }],
  user: "patient_42",
});

console.log(resp.choices[0].message.content);     // standard OpenAI response
console.log((resp as any).humane.user.mood);      // 0.28
console.log((resp as any).humane.safety.action);  // PROCEED | BLOCK

If Humane's safety gate returns BLOCK, we short-circuit before hitting OpenAI — no tokens spent on blocked messages.

Streaming

for await (const ev of client.stream({ userId: "u1", message: "tell me more" })) {
  if (ev.type === "metadata") console.log("state:", ev.data);
  if (ev.type === "token") process.stdout.write(ev.data.content);
  if (ev.type === "final") console.log("\nfull:", ev.data.response);
}

Webhook signature verification

import { verifyWebhookSignature } from "@humane-ai/sdk/webhook";

app.post("/webhook", express.raw({ type: "application/json" }), (req, res) => {
  const sig = req.header("X-Humane-Signature");
  if (!verifyWebhookSignature(process.env.HUMANE_WEBHOOK_SECRET!, req.body, sig)) {
    return res.status(401).end();
  }
  const event = JSON.parse(req.body.toString("utf8"));
  // … handle event
  res.sendStatus(200);
});

Idempotency

Retrying a transient network failure is safe — pass the same key and same body:

await client.process({
  userId: "u1",
  message: "hi",
  idempotencyKey: "req_8f3c...",
});

License

See LICENSE. Commercial use requires a contract; non-commercial/research use is free.