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

@lobehub/sdk

v1.0.20260911090131

Published

Official TypeScript SDK for the LobeHub REST API, generated from the OpenAPI spec

Readme

@lobehub/sdk

Official TypeScript SDK for the LobeHub REST API, generated from the OpenAPI spec in packages/openapi via @hey-api/openapi-ts.

Resource-style methods with full typing — every path, parameter, request body, and response comes from openapi.yml, and the HTTP runtime is inlined (zero dependencies).

Installation

npm install @lobehub/sdk

Usage

import { createLobeHub } from '@lobehub/sdk';

const lobehub = createLobeHub({
  // LobeHub API Key (`sk-lh-...`) or an OIDC JWT
  apiKey: process.env.LOBEHUB_API_KEY!,
});

const me = await lobehub.users.me();
const { data, error } = await lobehub.agents.list();
const agent = await lobehub.agents.get({ path: { id: 'agt_...' } });

await lobehub.agentGroups.create({ body: { name: 'My group' } });
await lobehub.files.uploadBatch({ body: { files: [/* … */] } });

Resources map to the API's top-level path segments: health, agentGroups, agents, files, knowledgeBases, messageTranslations, messages, models, permissions, providers, responses, roles, topics, users. Method names follow a fixed rule — list / get / create / update / delete plus PascalCase sub-segments (files.listChunks, roles.updatePermissions) — with a few curated names (files.uploadBatch, files.query, knowledgeBases.addFiles, users.me).

Point the client at another deployment with baseURL, and pass any other client option (custom fetch, headers, …):

const lobehub = createLobeHub({
  apiKey: 'sk-lh-...',
  baseURL: 'http://localhost:3010',
});

Raw spec types are exported from @lobehub/sdk/types.

Streaming responses

responses.create returns Server-Sent Events when body.stream: true. Opt out of JSON parsing with parseAs: 'stream' and read the raw stream from response.body:

const { response } = await lobehub.responses.create({
  body: { input: '…', model: '…', stream: true },
  parseAs: 'stream',
});
for await (const chunk of response.body!) {
  // decode SSE chunks
}

(First-class typed SSE methods will come with the spec's response schemas.)

Development

  • bun generate — regenerate src/generated/ from ../openapi/openapi.yml (run after the spec changes; naming rules live in openapi-ts.config.ts)
  • bun run build — build ESM + d.ts to dist/
  • bun run test — unit tests + generated-output drift check (local and release workflow only; not wired into PR CI)

Releasing

Publishing is automated by release-sdk.yml: every push to canary touching packages/sdk/** publishes 1.0.<UTC timestamp> to npm with provenance (manual workflow_dispatch also available). To ship a spec change, run bun generate and commit the regenerated output — the workflow's drift check (bun scripts/generate-sdk.ts --check) guards the published artifact.

Regular PR CI does not gate on spec drift — the check runs locally (bun run test) and inside the release workflow only.