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

sv-number-client

v0.2.0

Published

TypeScript client for the SV Number SMS verification API

Readme

sv-number

npm version License: ISC Node.js Version

Modern, fully typed TypeScript / Node.js client for the SV Number SMS Verification Service. Rent virtual phone numbers to receive verification SMS across hundreds of platforms (WhatsApp, Telegram, Apple, Google, and more).

Official API documentation: https://sms-verification-number.com/en/api-sms-activate/


Features

  • 📱 Virtual Phone Number Rental — Rent numbers for any service across global countries.
  • ⏳ Automated Polling — waitForCode() handles polling with customizable timeouts and intervals.
  • 🏷️ Price & Service Catalogs — Real-time lookup of available numbers and pricing via getPrices() and getServicesAndCost().
  • 📦 Dual Module Format — Full support for ES Modules and CommonJS.
  • 🛡️ Typed & Robust — Written in TypeScript with full TSDoc and SvNumberError exceptions.

Installation

npm install sv-number-client

Requires Node.js 18 or higher.


Quick Start (Safe Check)

The quick check only reads your current account balance and fetches available services. It does not order numbers or spend money.

TypeScript / ESM

import { SvNumber } from "sv-number";

const client = new SvNumber({
  apiKey: process.env.SV_NUMBER_API_KEY!,
});

const balance = await client.getBalance();
const services = await client.getServicesAndCost({ country: 0 });

console.log(`Balance: $${balance}`);
console.log(`Services in country 0: ${services.length}`);

CommonJS

const { SvNumber } = require("sv-number");

async function main() {
  const client = new SvNumber({
    apiKey: process.env.SV_NUMBER_API_KEY,
  });

  const balance = await client.getBalance();
  console.log(`Balance: $${balance}`);
}

main().catch(console.error);

Usage Guide

1. Renting a Number and Receiving an SMS

import { SvNumber, SvNumberError } from "sv-number";

const client = new SvNumber(process.env.SV_NUMBER_API_KEY!);

// 1. Order a number for Telegram (service 'tg') in country 0
const order = await client.getNumber({ service: "tg", country: 0 });
console.log(`Ordered phone number: ${order.phoneNumber} (ID: ${order.activationId})`);

// 2. Inform the service that you are ready to receive the SMS
await client.ready(order.activationId);

// 3. Poll for the verification code
try {
  const { code } = await client.waitForCode(order.activationId, {
    timeoutMs: 120_000,
    intervalMs: 3_000,
  });
  console.log(`Received SMS code: ${code}`);

  // 4. Mark activation completed
  await client.complete(order.activationId);
} catch (err) {
  if (err instanceof SvNumberError && err.code === "TIMEOUT") {
    console.error("SMS timed out, canceling order...");
    await client.cancel(order.activationId);
  } else {
    throw err;
  }
}

2. Checking Prices

// Get price matrix for country 0
const prices = await client.getPrices(0);
console.log("Prices:", prices);

Error Handling

When the API returns an error status (such as BAD_KEY, NO_NUMBERS, NO_BALANCE), the client throws an SvNumberError:

import { SvNumber, SvNumberError } from "sv-number";

try {
  const client = new SvNumber("invalid_key");
  await client.getBalance();
} catch (err) {
  if (err instanceof SvNumberError) {
    console.error(`SV Number error: ${err.code}`);
  }
}

License

ISC © api-kit contributors