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

@bayonai/sdk

v0.1.2

Published

TypeScript SDK for the BayonAI Firebase API.

Readme

@bayonai/sdk

TypeScript SDK for the BayonAI Firebase API.

Published package: @bayonai/sdk

npm install @bayonai/sdk
import { createBayonAiClient } from "@bayonai/sdk";

const bayonai = createBayonAiClient({
  apiKey: process.env.BAYONAI_API_KEY,
});

const response = await bayonai.conversations.send({
  personaId: "journalapp",
  messages: [{ role: "user", content: "TEST" }],
});

The SDK keeps the API's chat contract intact: messages is sent to BayonAI as a stringified JSON array.

The SDK has the deployed BayonAI API endpoint hardcoded. Consumers do not configure a base URL; endpoint changes are released with a new SDK version.

The package requires an environment with fetch, URL, and AbortController (for example, Node.js 18+ or a modern browser). A custom fetch implementation can be supplied when the host owns its transport.

Authentication

Server-side integrations can pass an organization API key:

const bayonai = createBayonAiClient({
  apiKey: process.env.BAYONAI_API_KEY,
});

External-user flows can use bearer tokens per request:

await bayonai.conversations.send(
  {
    personaId: "agent-1",
    messages: [{ role: "user", content: "Hello" }],
  },
  { bearerToken: accessToken },
);

API keys are for server-side integrations and should be kept in secret management. External-user sessions should use the per-request bearer token; the bearer token takes precedence over the configured API key. Pass credentials only through apiKey or bearerToken; the SDK deliberately removes authorization and x-api-key values supplied through custom headers.

Timeout and cancellation

Requests have no timeout by default for backward compatibility. Set a positive client-level timeout, and use an AbortController when the host needs to cancel one request:

const bayonai = createBayonAiClient({
  apiKey: process.env.BAYONAI_API_KEY,
  timeoutMs: 30_000,
});

const controller = new AbortController();
const response = await bayonai.conversations.send(
  {
    personaId: "journalapp",
    messages: [{ role: "user", content: "Hello" }],
  },
  { signal: controller.signal },
);

Timeouts and aborts reject with BayonAiError using kind: "network".

Response behavior

The SDK parses application/json and application/*+json responses. Successful HTTP 204 and 205 responses resolve to undefined; unsuccessful responses remain BayonAiError values with kind: "http", even when an upstream JSON body is empty or malformed.

CommonJS

The published package also supports CommonJS consumers:

const { createBayonAiClient } = require("@bayonai/sdk");

const bayonai = createBayonAiClient({
  apiKey: process.env.BAYONAI_API_KEY,
});

Verification and release

From packages/bayonai-sdk:

npm run build
npm test
npm run consumer:smoke
npm run release:dry-run

consumer:smoke verifies ESM imports, CommonJS requires, and TypeScript declarations from the packed tarball. Release changes are recorded in CHANGELOG.md; release:dry-run must pass before a real public publish.