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

@tubox/veyra-sdk

v1.0.1

Published

The official Veyra Node.js / TypeScript SDK

Readme

Veyra Node.js SDK

npm version Node.js TypeScript License CI

The official Veyra SDK for Node.js and TypeScript. It provides strict typings, streaming via async iterables, built-in retry logic, and resource-based namespaces.

Installation

npm install @tubox/veyra-sdk
# pnpm add @tubox/veyra-sdk
# yarn add @tubox/veyra-sdk

Quickstart

import Veyra from "@tubox/veyra-sdk";

const client = new Veyra({ apiKey: process.env.VEYRA_API_KEY });

const completion = await client.chat.completions.create({
  model: "gpt-5.4-mini",
  messages: [{ role: "user", content: "Hello" }],
});

console.log(completion.choices[0]?.message.content);
import Veyra from "@tubox/veyra-sdk";

const client = new Veyra();
const stream = await client.chat.completions.create({
  model: "gpt-5.4-mini",
  messages: [{ role: "user", content: "Count to 5" }],
  stream: true,
});

for await (const chunk of stream) {
  process.stdout.write(chunk.choices[0]?.delta.content ?? "");
}

Authentication

Use either:

  • VEYRA_API_KEY environment variable.
  • Explicit constructor option: new Veyra({ apiKey: "veyra_sk_..." }).

Resources At A Glance

| Namespace | Primary method | |---|---| | chat.completions | create() | | completions | create() | | responses | create() | | embeddings | create() | | images.generations | create() | | audio.transcriptions | create() | | models | list(), retrieve() | | quota | status(), listPlans() | | billing.usage | list(), dailySummary() | | billing.profile | retrieve(), upsert() | | apiKeys | create(), list(), update(), revoke() | | assistant | chat() | | health | check(), ready() |

Streaming

Use for await ... of on a stream returned from create({ stream: true }).

  • Early loop breaks are supported.
  • Use stream.toReadableStream() for edge/browser response piping.

Responses Reasoning

const response = await client.responses.create({
  model: "gpt-5.4-mini",
  input: "Explain the tradeoff in one paragraph.",
  reasoning: { effort: "medium", summary: "auto" },
  maxOutputTokens: 256,
});

const message = response.output.find((item) => item.type === "message");
console.log(message?.type === "message" ? message.content[0]?.text : "");

Pagination

Page<T> supports both item iteration and explicit page traversal:

const page = await client.billing.usage.list({ limit: 50 });
for await (const item of page) {
  console.log(item.id);
}

let current = page;
while (current.hasMore) {
  current = (await current.nextPage())!;
}

Error Handling

import { VeyraAPIError, VeyraRateLimitError } from "@tubox/veyra-sdk";

try {
  await client.chat.completions.create({ ... });
} catch (error) {
  if (error instanceof VeyraRateLimitError) {
    console.error(error.retryAfter);
  } else if (error instanceof VeyraAPIError) {
    console.error(error.httpStatus, error.code, error.requestId);
  }
}

Retries

Default retries: 2.

  • Configure globally: new Veyra({ maxRetries: 5 })
  • Configure per request: client.chat.completions.create(params, { maxRetries: 0 })

Retryable: network failures, 429, 500, 502, 503, 504.

Timeouts

Default timeout: 60_000 ms.

  • Global: new Veyra({ timeout: 30_000 })
  • Per request: client.models.list({ timeout: 10_000 })

Raw Responses

const raw = await client.withRawResponse.models.list();
console.log(raw.requestId, raw.httpStatus);

AbortSignal

const controller = new AbortController();
setTimeout(() => controller.abort(), 500);
await client.chat.completions.create(params, { signal: controller.signal });

Runtime Compatibility

  • Node.js 18+
  • Deno
  • Bun
  • Cloudflare Workers
  • Modern browsers

ESM + CJS

ESM:

import Veyra from "@tubox/veyra-sdk";

CJS:

const { Veyra } = require("@tubox/veyra-sdk");

TypeScript

The SDK is authored with strict TypeScript and exports all public request/response and error types from the package root.

Docs

See the full docs in docs/, the hand-written SDK reference in docs/sdk-api-reference.md, and generated TypeDoc API reference in docs/api-reference/. Release workflow guidance is documented in docs/releasing.md.

Project Policies