Skip to Content
Health DataContraindications

Contraindications

@loop/contraindications provides a comprehensive peptide contraindication database and validation system. It checks patient conditions, medications, and biomarker values against known safety data.

Installation

pnpm add @loop/contraindications

Quick Start

import { checkContraindications } from '@loop/contraindications'; const result = checkContraindications({ peptideSlug: 'bpc-157', userProfile: { conditions: ['pregnancy'], medications: ['warfarin'], age: 30, sex: 'female', }, }); if (result.ok) { console.log(result.value.allowed); // false console.log(result.value.matches); // Detailed match info console.log(result.value.absoluteCount); // Number of absolute contraindications console.log(result.value.relativeCount); // Number of relative (caution) contraindications }

API Reference

checkContraindications(request)

Check a single peptide against a user profile.

Parameters:

interface CheckRequest { peptideSlug: string; userProfile: UserProfile; } interface UserProfile { conditions: string[]; medications: string[]; age?: number; sex?: 'male' | 'female'; }

Returns: Result<CheckResult, ContraindicationError>

interface CheckResult { allowed: boolean; peptideSlug: string; matches: ContraindicationMatch[]; absoluteCount: number; relativeCount: number; } interface ContraindicationMatch { condition: string; severity: 'absolute' | 'relative'; reason: string; source: string; }

checkMultiplePeptides(peptideSlugs, userProfile)

Check multiple peptides at once:

import { checkMultiplePeptides } from '@loop/contraindications'; const results = checkMultiplePeptides( ['bpc-157', 'tb-500', 'mk-677', 'ipamorelin'], { conditions: ['type-2-diabetes'], medications: ['metformin'], age: 45, sex: 'male', } ); for (const result of results) { if (result.ok) { console.log(`${result.value.peptideSlug}: ${result.value.allowed ? 'allowed' : 'blocked'}`); } }

filterAllowedPeptides(peptideSlugs, userProfile)

Get only peptides without absolute contraindications:

import { filterAllowedPeptides } from '@loop/contraindications'; const allowed = filterAllowedPeptides( ['bpc-157', 'tb-500', 'mk-677'], { conditions: ['active-cancer'], medications: [], age: 55, sex: 'male' } ); // Returns slugs that are safe for this patient

Data Access

import { getPeptideRecord, getAllPeptideSlugs, isPeptideSupported } from '@loop/contraindications'; // Get the full contraindication record for a peptide const record = getPeptideRecord('bpc-157'); // List all supported peptides const slugs = getAllPeptideSlugs(); // Check if a peptide is in the database const supported = isPeptideSupported('bpc-157'); // true

Audit Logging

Every contraindication check is logged in an in-memory audit log:

import { getAuditLog, clearAuditLog } from '@loop/contraindications'; const log = getAuditLog(); // [{ timestamp, peptideSlug, userProfile, result, ... }] clearAuditLog();

Contraindication Database

The database covers all peptides in the Loop Health catalog. Each entry includes:

  • Absolute contraindications — Conditions that completely prevent use (e.g., pregnancy, active cancer)
  • Relative contraindications — Conditions requiring caution or monitoring (e.g., diabetes with GH peptides)
  • Medication interactions — Known drug interactions (e.g., BPC-157 + anticoagulants)
  • Age restrictions — Minimum/maximum age guidelines
  • Sex-specific — Sex-specific contraindications

Supported Peptides

Common peptides in the database include:

PeptideCategoryKey Contraindications
BPC-157RecoveryPregnancy, active cancer, anticoagulant use
TB-500RecoveryPregnancy, active cancer
IpamorelinGrowth HormoneActive cancer, diabetes (relative), pregnancy
CJC-1295Growth HormoneActive cancer, diabetes (relative)
MK-677Growth HormoneDiabetes, active cancer, congestive heart failure
SemaglutideMetabolicThyroid cancer history, pancreatitis, pregnancy
PT-141Sexual HealthUncontrolled hypertension, pregnancy
SemaxCognitivePregnancy (caution)
GHK-CuAnti-agingActive cancer
EpithalonAnti-agingActive cancer