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

simpleverify

v1.0.3

Published

Official Node.js/TypeScript client library for the SimpleVerify API - developer-first verification alerts (SMS, email, magic link)

Readme

SimpleVerify Node.js SDK

Official Node.js/TypeScript client library for the SimpleVerify API. Send and verify SMS codes, email codes, and magic links with a few lines of code.

Requirements

  • Node.js 18+

Installation

npm install simpleverify

Quick Start

import { SimpleVerifyClient } from 'simpleverify';

const client = new SimpleVerifyClient('vk_test_your_api_key_here');

// Send an SMS verification
const verification = await client.verifications.send({
  type: 'sms',
  destination: '+15551234567',
});

console.log(verification.verification_id); // "a1b2c3d4-..."
console.log(verification.status);           // "pending"

// Check the code the user entered
const result = await client.verifications.check(verification.verification_id, '482913');

if (result.valid) {
  console.log('Verified!');
}

Usage

Initialize the Client

// With just an API key
const client = new SimpleVerifyClient('vk_test_...');

// With options
const client = new SimpleVerifyClient({
  apiKey: 'vk_test_...',
  baseUrl: 'https://api.simpleverify.io', // default
  timeout: 30000,                          // default, in milliseconds
});

Send a Verification

// SMS
const verification = await client.verifications.send({
  type: 'sms',
  destination: '+15551234567',
});

// Email
const verification = await client.verifications.send({
  type: 'email',
  destination: '[email protected]',
});

// Magic link
const verification = await client.verifications.send({
  type: 'magic_link',
  destination: '[email protected]',
  redirect_url: 'https://yourapp.com/dashboard',
  failure_redirect_url: 'https://yourapp.com/auth/magic-link-result',
});

// With metadata
const verification = await client.verifications.send({
  type: 'sms',
  destination: '+15551234567',
  metadata: { user_id: 42 },
});

The response is a Verification object:

verification.verification_id // UUID
verification.type            // "sms", "email", or "magic_link"
verification.destination     // masked: "*******4567" or "u***@example.com"
verification.status          // "pending"
verification.expires_at      // ISO 8601 datetime
verification.environment     // "test" or "live"

Test Mode

When using a vk_test_ API key, the response includes the code or token so you can complete the flow without real SMS/email delivery:

verification.test?.code   // "482913" (SMS/email)
verification.test?.token  // 64-char string (magic link)

In live mode (vk_live_ key), verification.test is undefined.

If you set failure_redirect_url on a magic link, failed clicks redirect there with status (invalid, expired, or already_used) and verification_id query parameters.

Successful magic link clicks redirect with status=verified, verification_id, and a one-time exchange_code. Redeem that code from your backend:

const exchange = await client.verifications.exchange(verificationId, exchangeCode);

exchange.destination // verified email address
exchange.metadata    // original metadata object

Check a Code

const result = await client.verifications.check(verification.verification_id, '482913');

result.valid            // true or false
result.verification_id  // UUID
result.type             // present when valid
result.destination      // present when valid (masked)

An invalid code returns valid: false (not an error). Only check the valid field.

Get Verification Status

const status = await client.verifications.get(verification.verification_id);

status.status      // "pending", "verified", or "expired"
status.created_at  // ISO 8601 datetime

Error Handling

All API errors throw specific error classes extending SimpleVerifyError:

import {
  SimpleVerifyError,
  AuthenticationError,
  ValidationError,
  RateLimitError,
  NotFoundError,
} from 'simpleverify';

try {
  await client.verifications.send({ type: 'sms', destination: '+15551234567' });
} catch (e) {
  if (e instanceof RateLimitError) {
    console.log(`Rate limited. Retry in ${e.retryAfterSeconds} seconds.`);
  } else if (e instanceof ValidationError) {
    console.log('Validation errors:', e.details);
  } else if (e instanceof AuthenticationError) {
    console.log('Bad API key:', e.errorCode);
  } else if (e instanceof NotFoundError) {
    console.log('Verification not found.');
  } else if (e instanceof SimpleVerifyError) {
    console.log(`Status: ${e.httpStatus}, Code: ${e.errorCode}, Message: ${e.message}`);
  }
}

| HTTP Status | Error Class | |-------------|-------------| | 401 | AuthenticationError | | 404 | NotFoundError | | 422 | ValidationError | | 429 | RateLimitError | | Other | ApiError | | Network failure | ConnectionError |

TypeScript

This package includes full TypeScript type definitions. All request and response types are exported:

import type { SendVerificationRequest, Verification, VerificationCheck, TestData } from 'simpleverify';

License

MIT