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

verity-api

v1.0.0

Published

TypeScript/JavaScript SDK for Verity API - Medicare coverage policies and prior authorization

Downloads

110

Readme

Verity TypeScript SDK

TypeScript/JavaScript client library for the Verity API - Medicare coverage policies, prior authorization requirements, and medical code lookups.

Installation

npm install verity-api
# or
yarn add verity-api
# or
pnpm add verity-api

Quick Start

import { VerityClient } from 'verity-api';

// Initialize the client
const client = new VerityClient('vrt_live_YOUR_API_KEY');

// Look up a medical code
const result = await client.lookupCode({
  code: '76942',
  include: ['rvu', 'policies'],
});
console.log(result.data?.description);
// Output: "Ultrasonic guidance for needle placement"

// Check prior authorization requirements
const paCheck = await client.checkPriorAuth({
  procedureCodes: ['76942'],
  diagnosisCodes: ['M54.5'],
  state: 'TX',
});
console.log(`PA Required: ${paCheck.data?.pa_required}`);

// Search policies
const policies = await client.listPolicies({
  q: 'ultrasound guidance',
  policyType: 'LCD',
  limit: 10,
});

// Get specific policy details
const policy = await client.getPolicy('L33831', {
  include: ['criteria', 'codes'],
});

Features

  • Full TypeScript support - Complete type definitions included
  • Works everywhere - Node.js, browser, and edge runtimes
  • Tree-shakeable - ES modules for optimal bundle size
  • Zero dependencies - Uses native fetch API
  • Promise-based - Modern async/await API

Authentication

Get your API key from the Verity Dashboard.

const client = new VerityClient('vrt_live_YOUR_API_KEY');

// Or with custom config
const client = new VerityClient({
  apiKey: 'vrt_live_YOUR_API_KEY',
  baseUrl: 'https://verity.backworkai.com/api/v1',
  timeout: 30000, // 30 seconds
});

Usage Examples

Code Lookup

// Basic lookup
const result = await client.lookupCode({
  code: '76942',
});

// With additional data
const result = await client.lookupCode({
  code: '76942',
  codeSystem: 'HCPCS',
  jurisdiction: 'JM',
  include: ['rvu', 'policies'],
  fuzzy: true,
});

Policy Search

// Keyword search
const policies = await client.listPolicies({
  q: 'ultrasound guidance',
  mode: 'keyword',
  policyType: 'LCD',
  status: 'active',
  limit: 50,
});

// Semantic search
const policies = await client.listPolicies({
  q: 'imaging guidance for procedures',
  mode: 'semantic',
});

// Pagination
if (policies.meta?.pagination?.has_more) {
  const nextPage = await client.listPolicies({
    cursor: policies.meta.pagination.cursor || undefined,
  });
}

Prior Authorization

const result = await client.checkPriorAuth({
  procedureCodes: ['76942', '76937'],
  diagnosisCodes: ['M54.5', 'G89.29'],
  state: 'TX',
  payer: 'medicare',
});

if (result.data?.pa_required) {
  console.log('Prior authorization required!');
  console.log('Documentation needed:', result.data.documentation_checklist);
}

Policy Comparison

const comparison = await client.comparePolicies({
  procedureCodes: ['76942'],
  policyType: 'LCD',
  jurisdictions: ['JM', 'JH', 'JK'],
});

comparison.data?.comparison?.forEach((juris) => {
  console.log(`${juris.jurisdiction}: ${juris.policies?.length || 0} policies`);
});

Coverage Criteria Search

const criteria = await client.searchCriteria({
  q: 'diabetes',
  section: 'indications',
  policyType: 'LCD',
  limit: 25,
});

Jurisdictions

const jurisdictions = await client.listJurisdictions();
jurisdictions.data?.forEach((j) => {
  console.log(`${j.jurisdiction_code}: ${j.mac_name} (${j.states?.join(', ')})`);
});

Error Handling

import {
  VerityClient,
  AuthenticationError,
  ValidationError,
  NotFoundError,
  RateLimitError,
  VerityError,
} from 'verity-api';

try {
  const result = await client.lookupCode({ code: '76942' });
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof ValidationError) {
    console.error('Invalid parameters:', error.message);
  } else if (error instanceof NotFoundError) {
    console.error('Resource not found');
  } else if (error instanceof RateLimitError) {
    console.error('Rate limit exceeded. Resets at:', error.reset);
  } else if (error instanceof VerityError) {
    console.error('API error:', error.message);
  }
}

Browser Usage

<script type="module">
  import { VerityClient } from 'https://cdn.skypack.dev/verity-api';
  
  const client = new VerityClient('vrt_live_YOUR_API_KEY');
  const result = await client.lookupCode({ code: '76942' });
  console.log(result.data);
</script>

Requirements

  • Node.js 14+ or modern browser with fetch API
  • TypeScript 4.5+ (for TypeScript projects)

License

MIT License - see LICENSE file for details.

Support

  • Documentation: https://verity.backworkai.com/docs
  • Issues: https://github.com/tylerbryy/verity-ts/issues
  • Email: [email protected]