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

@rxbenefits/types

v1.0.0

Published

TypeScript type definitions for RxBenefits applications

Readme

@rxbenefits/types

TypeScript type definitions for RxBenefits healthcare benefits management applications.

CI Status npm version License: MIT

Overview

This package provides comprehensive TypeScript type definitions for all domain entities used across RxBenefits applications, including:

  • User Management: Users, roles, and permissions
  • Organization Management: Organizations, groups, and locations
  • Member Management: Employees, dependents, and coverage
  • Clinical & Pharmacy: Drugs, conditions, and intervention lists
  • Business Operations: Applications, files, invoices, and issues
  • System Configuration: Validation rules, events, and module definitions

Installation

npm install @rxbenefits/types

or with Yarn:

yarn add @rxbenefits/types

Requirements

  • TypeScript: >= 5.0.0
  • Node.js: >= 20.0.0

Usage

Importing Types

import { Organization, UserProfile, Employee, Dependent, Drug, APIError } from '@rxbenefits/types';

// Use types in your code
const organization: Organization = {
  organizationNo: 12345,
  name: 'Example Healthcare',
  effectiveDate: '2025-01-01',
  eligibilityContact: '[email protected]',
  eligibilityVendor: 'Vendor Name',
  medicalVendorContact: '[email protected]',
  invoiceContact: '[email protected]',
  type: 'standard',
  processStatus: 1,
  exportPharmacyClaimsForAllGroups: true,
  generateEmployeeSSN: false,
  generateMemberUponClaimReconciliation: false,
};

Using Type Guards

The package includes type guard functions to safely check types at runtime:

import { isOrganization, isApiError } from '@rxbenefits/types';

// Type guard for Organization
function processOrganization(data: unknown) {
  if (isOrganization(data)) {
    // TypeScript knows data is Organization here
    console.log(`Processing: ${data.name}`);
    return data.organizationNo;
  }
  throw new Error('Invalid organization data');
}

// Type guard for API errors
async function fetchData() {
  try {
    // API call
  } catch (error) {
    if (isApiError(error)) {
      // TypeScript knows error is APIError here
      console.error(`API Error: ${error.data.error}`);
      console.error(`Status: ${error.status}`);
    }
  }
}

Available Type Categories

API & Error Handling

  • APIError - API error response structure
  • APIErrorData - Error data payload
  • isApiError() - Type guard for API errors

User Management

  • UserProfile - User profile information
  • Users - User entity
  • Roles - User roles and permissions

Organization Management

  • Organization - Organization entity with all configuration
  • AuthOrganization - Simplified organization for authentication
  • BenefitPackage - Benefit package configuration
  • BenefitPlanHistory - Historical benefit plan data
  • MedDSubsidy - Medicare Part D subsidy information
  • Group - Organization group entity
  • Locations - Location entities
  • isOrganization() - Type guard for Organization

Member Management

  • Employee - Employee information
  • EmployeeCoverage - Coverage details
  • Dependent - Dependent information
  • MemberSearch - Search criteria and results
  • PlanCoverage - Plan coverage details

Clinical & Pharmacy

  • Drugs - Drug entity information
  • Condition - Clinical condition types
  • InterventionDrugList - Drug intervention lists
  • TargetDrugList - Target drug lists
  • Pharmacies - Pharmacy entity information

Business Operations

  • Application - Application types
  • EligibilityImport - Eligibility import structures
  • Files - File management types
  • Invoice - Invoice entities
  • Issues - Issue tracking types

System & Configuration

  • Lists - List types
  • ListType - List type definitions
  • Events - System event types
  • ValidationRules - Validation rule definitions
  • ModuleDefinition - Module configuration
  • Window - Window/global type extensions

Development

Setup

# Clone the repository
git clone https://github.com/RxBenefits/rxbenefits-types.git
cd rxbenefits-types

# Install dependencies
npm install

Build

# Production build
npm run build

# Development build with source maps
npm run build:dev

# Watch mode
npm run build:watch

Testing

# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Run tests with coverage
npm run test:coverage

Linting and Formatting

# Run ESLint
npm run lint

# Fix ESLint issues
npm run lint:fix

# Format code with Prettier
npm run format

# Check formatting
npm run format:check

Validation

Run all checks before committing:

npm run validate

This runs type checking, linting, and tests.

Contributing

We welcome contributions! Please follow these guidelines:

  1. Fork the repository and create your branch from main
  2. Add tests for any new types or type guards
  3. Ensure tests pass: Run npm run validate
  4. Follow code style: Use Prettier and ESLint configurations
  5. Write good commit messages: Use Conventional Commits
  6. Submit a pull request

Commit Message Format

type(scope): subject

body

footer

Types: feat, fix, docs, style, refactor, test, chore

Example:

feat(organization): add new BenefitPlan type

Added BenefitPlan interface to support new benefit plan structure

BREAKING CHANGE: Organization.benefitPlans is now an array of BenefitPlan

Versioning

This package follows Semantic Versioning:

  • Major version (X.0.0): Breaking changes to existing types
  • Minor version (0.X.0): New types or non-breaking additions
  • Patch version (0.0.X): Bug fixes and documentation updates

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Related Packages

  • @rxbenefits/api - API client library
  • @rxbenefits/utils - Utility functions
  • @rxbenefits/constants - Application constants
  • @rxbenefits/ui - UI component library

Acknowledgments

Built with ❤️ by the RxBenefits Engineering Team for the healthcare benefits management community.