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

@visiblebase/client

v0.1.2

Published

VisibleBase user and admin client SDK.

Readme

@visiblebase/client

@visiblebase/client 是 VisibleBase 的客户端 SDK。

它提供两类客户端:

  • UserClient:给终端用户产品调用 Base,也负责公开插件入口,例如登录、注册、webhook
  • AdminClient:给可信后端管理 product、签发 user_token、维护 Runtime env

安装

pnpm add @visiblebase/client

UserClient 调公开插件

import { UserClient } from "@visiblebase/client";

const guest = new UserClient({
  base_url: "http://127.0.0.1:3001",
});

const session = await guest.plugin("auth").post("login", {
  email: "[email protected]",
  password: "password123",
  product_id: "prod_xxx",
});

UserClient

import { UserClient } from "@visiblebase/client";
import type { UIMessageChunk } from "ai";

const client = new UserClient({
  base_url: "http://127.0.0.1:3001",
  product_id: "prod_xxx",
  user_token: "ub_xxx",
});

const models = await client.models();

const message = await client.text({
  model: models.primary(),
  prompt: "你好",
});

const stream = await client.stream({
  model: models.primary(),
  prompt: "流式输出一段文案",
});

const reader = stream.getReader();
const firstChunk: UIMessageChunk | undefined = (await reader.read()).value;

text() 固定返回 AI SDK UIMessagestream() 固定返回 ReadableStream<UIMessageChunk>,适配 Base 侧的 createUIMessageStreamResponse()streamText().toUIMessageStreamResponse()

image()video() 也固定返回 AI SDK UIMessage,建议用 message 的 file part 表达图片或视频文件。

需要调用用户侧插件路由时,使用 plugin(id)

const usage = await client.plugin("usage").get("me");

AdminClient

import { AdminClient } from "@visiblebase/client";

const admin = new AdminClient({
  base_url: "http://127.0.0.1:3001",
  admin_secret_key: "admin_xxx",
});

const product = await admin.products.create({
  name: "Demo Product",
});

const token = await admin.tokens.apply({
  product_id: product.product_id,
  user_id: "user_123",
  ttl: "30m",
});

需要调用管理侧插件路由时,使用 plugin(id)

const events = await admin.plugin("usage").get("events");

文档