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

himaia-sdk

v0.3.1

Published

TypeScript SDK for the himaia voice API. Wraps /v1/generate and /v1/personas. Apache-2.0.

Readme

himaia-sdk

TypeScript client for the himaia voice API.

Wraps POST /v1/generate and GET /v1/personas. Two methods, one HimaiaClient class, fetch-based — runs in browsers, Node 18+, Bun, Deno, and edge runtimes.

Apache-2.0. Source: github.com/fuselinkapp/himaia-sdk.

Install

npm install himaia-sdk

Quick start

import { HimaiaClient } from "himaia-sdk";

const client = new HimaiaClient({ apiKey: process.env.HIMAIA_KEY! });

// Hear the starters.
const { starters } = await client.listPersonas();

// Speak.
const { audio } = await client.generate({
  mode: "voiced",
  persona: "himaia/warm_confidant",
  input: "It's been a long week and I don't know where to start.",
});

const url = URL.createObjectURL(audio);
new Audio(url).play();

API

new HimaiaClient(options)

| Option | Type | Default | Notes | |----------|----------------|------------------------|-------| | apiKey | string | required | Bearer token from the himaia dashboard. | | baseUrl| string | https://api.himaia.dev | Override for self-hosted / staging. | | fetch | typeof fetch | globalThis.fetch | Inject for tests, polyfills, edge runtimes. |

client.listPersonas()Promise<ListPersonasResult>

Returns { personas, starters }:

  • personas — built-in TS roster used by the Cinematic pipeline.
  • starters — v0.2 YAML personas (himaia/<slug>) used by Voiced.

client.generate(req)Promise<GenerateResult>

Discriminated by mode:

  • { mode: "basic", text, voice?, tone?, ... } — plain text → TTS.
  • { mode: "voiced", persona, input, scene?, fidelity?, voice?, ... } — single-call persona-driven (recommended for chat / NPC apps). fidelity (verbatim | shape | rewrite) wins over the persona's voice.fidelity_default and any scene override.
  • { mode: "cinematic", context, persona_id?, fidelity?, ... } — three-stage cinematic pipeline.

Returns:

{
  audio: Blob,                       // audio/wav
  headers: Record<string, string>,   // lowercased x-himaia-* response headers
  durationSeconds: number | null,
  chargeCents: number | null,
  callId: string | null,
}

Errors

Every non-2xx throws HimaiaError:

import { HimaiaError } from "himaia-sdk";

try {
  await client.generate({ mode: "voiced", persona: "himaia/warm_confidant", input: "" });
} catch (err) {
  if (err instanceof HimaiaError) {
    console.error(err.status, err.code, err.message);
  }
  throw err;
}

status is the HTTP status. code is the API's machine-readable code when present (e.g. "low_balance"). message is the human-readable string from the API body.

The SDK does not auto-retry. Wrap your own retry logic if you need it; we resisted prescribing one because the right retry policy depends on the call site (chat replies want fast-fail; batch generation wants exponential backoff).

React example

A 50-line HimaiaPlayer component is in examples/react-player.tsx. Drop it into Vite or CRA, pass an apiKey prop, done.

What's not in here

  • Streaming TTS. The API doesn't stream audio yet; the SDK will follow when it does.
  • Auto-retry. See above.
  • Per-status error subclasses (InsufficientBalanceError, etc.) — err.status + err.code is enough for one-off catches.
  • A CLI binary. Programmatic only.

License

Apache-2.0. See LICENSE. Made by himaia · © Fuse Link Inc..

The voice.persona spec the API consumes is also Apache-2.0: github.com/fuselinkapp/himaia-voice-persona.