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

numberotp

v0.1.1

Published

Official NumberOTP API client — virtual numbers for SMS / OTP verification

Readme

numberotp (TypeScript / JavaScript)

The official client for the NumberOTP API: real phone numbers for SMS / OTP verification. Works in Node 20+, Deno, Bun, Cloudflare Workers, Vercel Edge and browsers, with zero dependencies.

npm install numberotp

Get an API key at numberotp.com/dashboard/developer and set it as NOTP_API_KEY. Guides: numberotp.com/docs/sdks.

import { NumberOTP } from 'numberotp'

const notp = new NumberOTP() // reads NOTP_API_KEY

// Buy a UK WhatsApp number and wait for the code (refunded automatically if none arrives)
const act = await notp.activations.createAndWait(
  { service: 'wa', country: '16' },
  { onNumber: n => console.log('Use this number:', n.phoneNumber) },
)
console.log('Code:', act.otp)

Finding codes

await notp.services.search({ q: 'discord.com' })       // → [{ code: 'ds', name: 'Discord' }]
await notp.prices.get({ service: 'wa' })                // price, stock and success rate by country and pool
await notp.countries.list()

Numbers

const n = await notp.activations.create({ service: 'tg', country: '187', pool: 'auto', max_price: 3 })
const act = await notp.activations.waitForCode(n.data.id, { timeout: '20m' })
await notp.activations.resend(n.data.id)                // another SMS on the same number
await notp.activations.finish(n.data.id)                // done
await notp.activations.cancel(n.data.id)                // no SMS? cancel → full refund
await notp.activations.list({ status: 'waiting' })

waitForCode throws ActivationClosedError if the number expired or was canceled (it's refunded), and WaitTimeoutError if your timeout passes first.

Live events

for await (const e of notp.events.stream()) {
  if (e.type === 'activation.code_received') console.log(e.data.otp)
}

The stream reconnects by itself and resumes from where it left off, so no event is skipped.

Webhooks

import { verifyWebhook } from 'numberotp'
const ok = await verifyWebhook(rawBody, req.headers['x-numberotp-signature'], process.env.NOTP_WEBHOOK_SECRET!)

Signing in users (apps, extensions, CLIs)

const notp = new NumberOTP({ onTokens: t => secureStore.save(t) })   // persist the rotating refresh token
await notp.auth.deviceLogin({ client: 'cli', onCode: c => console.log(c.user_code, c.verification_uri_complete) })
// or: await notp.auth.sendEmailCode({ email }); await notp.auth.signInWithEmailCode(email, code)
// or: await notp.auth.signInWithIdToken('apple', idToken, { nonce })

Expired access tokens are refreshed automatically.

Reliability

  • Every purchase, rental and top-up sends an Idempotency-Key. Retries after a timeout can never buy twice.
  • Network errors, 429 and 5xx are retried with backoff, but only where retrying is safe.
  • Errors are typed: InsufficientBalanceError, NotFoundError (with code: 'NO_NUMBERS_AVAILABLE'), ConflictError, AuthenticationError and so on. Each has status and a stable code.

All 62 API operations are available. Resellers get notp.reseller.* and notp.resellerPublic.*.