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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@vouch-in/core

v0.1.7

Published

Core utilities for Vouch SDK - Email validation and device fingerprinting

Readme

@vouch-in/core

Core utilities and shared types for the Vouch SDK ecosystem. This package provides the foundation for email validation and device fingerprinting across all Vouch SDK implementations.

Installation

npm install @vouch-in/core
# or
pnpm add @vouch-in/core
# or
yarn add @vouch-in/core

Features

  • Error Classes - Typed error classes for better error handling
  • Type Definitions - Shared TypeScript types for validation and fingerprinting
  • Validation Utilities - Email format validation helpers
  • Crypto Utilities - SHA-256 hashing for fingerprint generation
  • Version Utilities - SDK version parsing and validation

Usage

Error Handling

import {
  VouchError,
  ValidationError,
  NetworkError,
  ConfigurationError,
  isVouchError,
  isNetworkError,
} from '@vouch-in/core';

try {
  await vouch.validate(email);
} catch (error) {
  if (isNetworkError(error)) {
    if (error.statusCode === 401) {
      console.log('Invalid API key');
    } else if (error.statusCode === 429) {
      console.log('Rate limited, retry later');
    }
  } else if (isVouchError(error)) {
    console.log('Vouch SDK error:', error.message);
  }
}

Types

import type {
  VouchOptions,
  ValidationRequest,
  ValidationResponse,
  ValidationAction,
  CheckResult,
  ValidationToggles,
  BaseFingerprint,
  BaseSignals,
} from '@vouch-in/core';

// Configure SDK options
const options: VouchOptions = {
  endpoint: 'https://api.vouch.expert',
  apiVersion: 'latest',
};

// Handle validation responses
function handleResponse(response: ValidationResponse) {
  if (response.recommendation === 'allow') {
    console.log('Email validated successfully');
  }
}

Validation Utilities

import { isValidEmail } from '@vouch-in/core';

if (isValidEmail('[email protected]')) {
  console.log('Valid email format');
}

Crypto Utilities

import { sha256Hex } from '@vouch-in/core';

const hash = await sha256Hex('data to hash');

Version Utilities

import {
  isValidSdkVersion,
  createSdkVersion,
  parseSdkVersion,
} from '@vouch-in/core';

// Validate SDK version format
isValidSdkVersion('@vouch-in/[email protected]'); // true

// Create version string
const version = createSdkVersion('@vouch-in/js', '1.0.0');
// '@vouch-in/[email protected]'

// Parse version string
const parsed = parseSdkVersion('@vouch-in/[email protected]');
// { package: '@vouch-in/js', version: '1.0.0' }

API Reference

Error Classes

| Class | Description | |-------|-------------| | VouchError | Base error class for all Vouch SDK errors | | ValidationError | Thrown when email validation fails | | NetworkError | Thrown when network requests fail (includes statusCode) | | ConfigurationError | Thrown when SDK configuration is invalid |

Type Guards

| Function | Returns | |----------|---------| | isVouchError(error) | error is VouchError | | isValidationError(error) | error is ValidationError | | isNetworkError(error) | error is NetworkError | | isConfigurationError(error) | error is ConfigurationError |

Types

| Type | Description | |------|-------------| | VouchOptions | SDK configuration options | | ValidationRequest | Email validation request payload | | ValidationResponse | Validation API response | | ValidationAction | Enum: ALLOW, BLOCK, FLAG | | CheckResult | Individual validation check result | | ValidationToggles | Toggle settings for validation checks | | BaseFingerprint | Base fingerprint structure | | BaseSignals | Base signal group interface |

Internal Package

This package is primarily intended for internal use within the Vouch SDK ecosystem. While it's published publicly for use by platform-specific SDKs, the API may change between versions.

For end-user applications, use the platform-specific SDKs instead:

License

See LICENSE for details.