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

mankai

v0.3.1

Published

Unofficial: TypeScript clients for Sakura Internet services.

Readme

mankai

Unofficial: TypeScript clients for Sakura Internet services.

TypeScript clients for Sakura Internet cloud APIs, generated from their published OpenAPI specs:

Installation

bun add mankai
npm install mankai
yarn add mankai
pnpm add mankai

Usage

AI Engine

import { AiEngine } from "mankai";

const client = new AiEngine({ apiKey: process.env.SAKURA_AI_ENGINE_API_KEY! });

// Chat completion (OpenAI Chat Completions compatible)
const chatCompletion = await client.createChatCompletion({
  model: "your-model",
  messages: [{ role: "user", content: "Hello!" }],
});

// Embeddings
const embeddings = await client.createEmbeddings({
  model: "your-embedding-model",
  input: "Hello!",
});

// Message (Anthropic Messages API compatible)
const message = await client.createMessage({
  model: "your-model",
  maxTokens: 1024,
  messages: [{ role: "user", content: "Hello!" }],
});

// Response (OpenAI Responses API compatible)
const response = await client.createResponse({
  model: "your-model",
  input: "Hello!",
});

// Speech-to-text
const transcription = await client.createTranscription({
  file: audioBlob,
});

// Text-to-speech
const wav = await client.createSpeech({
  model: "your-tts-model",
  input: "Hello!",
});

// VOICEVOX-compatible TTS
const audioQuery = await client.createTtsAudioQuery({ text: "Hello!", speaker: 1 });
const synthesized = await client.synthesizeTtsSpeech({
  speaker: 1,
  ttsSynthesisRequest: { ...audioQuery, kana: audioQuery.kana ?? "" },
});

By default requests go to https://api.ai.sakura.ad.jp. Pass basePath to override it:

new AiEngine({ apiKey: "...", basePath: "https://example.com" });

Object Storage

The Object Storage API is split across two base URLs: a "federation" endpoint for site discovery and bucket create/delete, and a per-site endpoint for everything else (account, permissions, bucket details). ObjectStorage keeps both configured internally and routes each method appropriately.

import { ObjectStorage } from "mankai";

const client = new ObjectStorage({
  accessToken: process.env.SAKURA_OBJECT_STORAGE_ACCESS_TOKEN!,
  accessTokenSecret: process.env.SAKURA_OBJECT_STORAGE_ACCESS_TOKEN_SECRET!,
  site: "isk01", // optional, defaults to "isk01"; discover sites via listClusters()
});

const { data: clusters } = await client.listClusters();
const { data: buckets } = await client.listBuckets();

IAM

The IAM API is organized into one resource per class (users, groups, projects, service principals, ...) rather than a single DefaultApi. Iam groups the generated clients under friendly names, sharing one set of credentials:

import { Iam } from "mankai";

const client = new Iam({ accessToken: process.env.SAKURA_IAM_ACCESS_TOKEN! });

const { items: users } = await client.users.listUsers({});
const { items: projects } = await client.projects.listProjects({});

SimpleMQ

import { SimpleMq } from "mankai";

const client = new SimpleMq({ apiKey: process.env.SAKURA_SIMPLEMQ_API_KEY! });

await client.sendMessage({ queueName: "your-queue", sendRequest: { content: "Hello!" } });
const received = await client.receiveMessage({ queueName: "your-queue" });

Simple Notification

import { SimpleNotification } from "mankai";

const client = new SimpleNotification({
  accessToken: process.env.SAKURA_ACCESS_TOKEN!,
  accessTokenSecret: process.env.SAKURA_ACCESS_TOKEN_SECRET!,
});

const destinations = await client.listCommonServiceItems();

Examples

Runnable examples for every client live in examples/:

See examples/README.md for how to run them.

Development

bun install
bun run build       # build the package (dist/)
bun run lint         # check formatting and lint
bun run lint:fix     # autofix lint issues
bun run format       # format the codebase
bun run typecheck    # type-check with tsc

Regenerating the API client

src/openapi/* is generated from upstream OpenAPI specs via openapi-generator-cli and is checked into the repository. src/ai-engine.ts, src/object-storage.ts, src/iam.ts, src/simple-mq.ts, and src/simple-notification.ts are hand-written, user-friendly wrappers on top of it and are not regenerated.

bun run generate:openapi

Requires Java 11+ on PATH. Specs are configured in scripts/generate-openapi.ts.

Releasing

This project uses Changesets:

bun run changeset       # record a change
bun run version         # bump versions and update changelogs
bun run release         # build and publish to npm

Releases are automated by .github/workflows/release.yml via changesets/action:

  1. Merging a PR with changesets into main makes the workflow open/update a "Version Packages" PR.
  2. Merging that PR triggers the workflow again, which builds and publishes to npm.

Publishing uses npm's Trusted Publishing (OIDC) instead of a long-lived NPM_TOKEN. This requires a one-time setup on npmjs.com: on the package's Settings → Trusted Publisher, add a GitHub Actions publisher pointing at this repository, workflow file release.yml, and (if used) the environment name.

License

MIT