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

@withone/sdk

v0.0.4

Published

The One SDK for Node — typed client over the One API.

Readme

@withone/sdk

The One SDK for Node — a typed client over the One API.

It is a thin, typed binding over the Rust one client: every typed action and its route/credential handling is generated from and executed by Rust. The JavaScript layer adds no behavior — HTTP, retries, route templating, and the merge/remove overrides all run in the native client.

Install

pnpm add @withone/sdk

No build step, no toolchain. The package ships prebuilt native binaries per platform (linux-x64-gnu, linux-arm64-gnu, linux-x64-musl, darwin-x64, darwin-arm64, win32-x64-msvc) as optionalDependencies; your package manager installs only the one matching your machine. Node only (≥ 18).

Usage

import { One, gmail } from '@withone/sdk'

const one = new One(process.env.ONE_SECRET!)

const res = await one
  .connection('my-gmail-connection')
  .run(
    gmail.createUsersDraft({
      path: { userId: 'me' },
      body: { message: { raw: base64Email } },
    }),
  )

console.log(res.status, res.data)
  • Typed inputs. Each action exposes exactly the fields it needs. Required route variables (e.g. userId) are required fields — omit one and it does not compile. Const headers the action requires are injected for you, never asked.
  • Connections. one.connection(key) scopes a call to a connection; the key is sent as X-One-Connection-Key.
  • From the environment. One.fromEnv() reads ONE_SECRET and the optional ONE_BASE_URL.

Overrides

When an action's typed surface isn't enough, chain escape hatches. These only collect directives — they are applied by the Rust Operation:

one.connection(key).run(
  gmail
    .createUsersDraft({ path: { userId: 'me' }, body })
    .mergeBody({ fieldTheSchemaOmits: 1 }) // add body fields
    .mergeQuery({ debug: true })
    .mergeHeaders({ 'X-Trace': 'abc' })
    .removeHeader('X-One-Secret')
    .removeQuery('page')
    .rawBody(new Uint8Array(bytes)), // non-JSON payload
)

Raw calls

Every action is also reachable generically (useful for actions the typed surface skips). Construct the request yourself and pass it through:

import { One } from '@withone/sdk'
// one.connection(key).run(...) accepts any built Action

How it's built

There is a single source of truth: the committed action snapshots (one/actions/*.json). The Rust one-codegen crate normalizes them once (const-hiding, envelope naming, Handlebars route-variable extraction) and emits both the Rust typed client and a manifest. This package translates that manifest into the typed TypeScript surface, so the two clients cannot drift.

Development

pnpm install
pnpm run build       # native addon + typed actions + bundle

Individual steps:

| script | does | | --- | --- | | build:native | compiles the napi addon (native.js / native.d.ts / *.node) | | manifest | runs the Rust one-codegen-manifest binary → actions.manifest.json | | gen | manifest + generates src/generated/<platform>.ts | | build:ts | tsupdist/ (ESM + CJS + types) |

A quick end-to-end check: node scripts/smoke.mjs.