Quick start
Installation and browser imports
Package manager
npm install @bmitdee/core
Direct browser module
import { calculateTDEE } from "https://www.bmitdee.com/developers/sdk/core.js";Stable package · v1.0.0
@bmitdee/core
Dependency-free deterministic calculations. Functions validate units and supported ranges, and return formula metadata, assumptions and warnings.
| Function | Primary input | Output |
|---|---|---|
calculateBMI | weightKg, heightCm | BMI, category, metadata |
calculateBMR | sex, age, weight, height, optional body fat/formula | BMR and formula details |
calculateTDEE | BMR inputs + activity multiplier | TDEE, BMR, assumptions |
compareTDEEFormulas | TDEE inputs | Formula results and spread |
calculateMacros | calories + preset/split | Protein, fat and carbohydrate grams |
calculateHealthyWeightRange | heightCm | Adult BMI-based kg/lb reference |
calculateCalorieDeficit | TDEE + deficit | Target, applied deficit, floor status |
convertWeight / convertHeight | value, from, to | Converted numeric value |
Signature example
calculateTDEE(input: TDEEInput): TDEEResultResult contract
{
"value": 2731.88,
"unit": "kcal/day",
"package": "@bmitdee/core",
"packageVersion": "1.0.0",
"formula": "mifflin-st-jeor",
"formulaVersion": "1.0.0",
"assumptions": [...],
"warnings": [...]
}Formula interpretation and citations remain available on Formula Sources.
Experimental package · v0.1.0
@bmitdee/adaptive
The engine estimates a working TDEE from longitudinal weight and calorie records. It is not direct calorimetry.
analyzeAdaptiveTDEE(entries, { formulaTdee, windowDays, bootstrapIterations })Processing sequence
- Validate ISO dates, weights and calorie records.
- Deduplicate by date and select a 14-, 21-, 28-, 42-day or full-history window.
- Fit weight against calendar time.
- Screen large robust residual outliers.
- Calculate calorie/weight coverage and weekly weight trend.
- Infer TDEE using average intake and short-term weight trend.
- Produce a deterministic residual-bootstrap interval.
- Return quality score, exclusions, method metadata and warnings.
Synthetic scenarios
generateSyntheticScenario() creates privacy-safe histories for tests, screenshots and demonstrations.
Experimental package · v0.1.0
@bmitdee/elements
Standard Custom Elements with Shadow DOM styles and local calculations.
<script type="module" src="/developers/sdk/elements.js"></script> <bmitdee-tdee-calculator></bmitdee-tdee-calculator>
Available elements:
<bmitdee-tdee-calculator><bmitdee-bmr-calculator><bmitdee-bmi-calculator><bmitdee-macro-calculator><bmitdee-healthy-weight><bmitdee-adaptive-summary>
Result event
element.addEventListener("bmitdee-result", event => {
console.log(event.detail);
});Theming
bmitdee-tdee-calculator {
--bmitdee-primary: #0f766e;
--bmitdee-radius: 18px;
--bmitdee-surface: #ffffff;
}Open the live component gallery.Experimental package · v0.1.0
@bmitdee/cli
bmitdee tdee input.json bmitdee adaptive history.json cat input.json | bmitdee bmi
Commands: bmi, bmr, tdee, macros, healthy-weight, deficit, compare, adaptive, and synthetic.
Reproducibility
Website, package and formula versions are separate
- BMITDEE website release: V3.4.0
- Core package: 1.0.0
- Adaptive package: 0.1.0
- Formula versions are included in each result.
A numeric behavior change requires a changelog entry and updated test vectors.
Boundaries
Privacy, intended use and safe integration
- The SDK modules make no network requests.
- Web Components do not transmit user inputs.
- Host applications control any storage or analytics.
- Do not send measurements, calorie histories or health notes to BMITDEE analytics.
- Outputs are educational estimates, not diagnosis or treatment.
- Do not expose production credentials or user records in GitHub issues.
Browser modules
Direct module files
/developers/sdk/core.js | Download |
/developers/sdk/adaptive.js | Download |
/developers/sdk/elements.js | Download |
| Complete source | Download ZIP |