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/contraindicationsQuick 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 patientData 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'); // trueAudit 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:
| Peptide | Category | Key Contraindications |
|---|---|---|
| BPC-157 | Recovery | Pregnancy, active cancer, anticoagulant use |
| TB-500 | Recovery | Pregnancy, active cancer |
| Ipamorelin | Growth Hormone | Active cancer, diabetes (relative), pregnancy |
| CJC-1295 | Growth Hormone | Active cancer, diabetes (relative) |
| MK-677 | Growth Hormone | Diabetes, active cancer, congestive heart failure |
| Semaglutide | Metabolic | Thyroid cancer history, pancreatitis, pregnancy |
| PT-141 | Sexual Health | Uncontrolled hypertension, pregnancy |
| Semax | Cognitive | Pregnancy (caution) |
| GHK-Cu | Anti-aging | Active cancer |
| Epithalon | Anti-aging | Active cancer |