Skip to main content

Examples

The Model Health SDK ships with two reference example apps — one for iOS and one for the web (TypeScript). Both implement the complete SDK workflow end-to-end: session management, camera calibration, subject calibration, activity recording and analysis retrieval.

They're useful for:

  • Getting oriented — see how all the pieces fit together before building your own integration
  • Reference — copy patterns directly into your own project

Where to Get Them

Both example apps live in the model-health repository under examples/:

examples/
├── ios/ — SwiftUI app for iOS
└── ts/ — Vite web app (TypeScript/JavaScript)

Clone the repository to get started:

git clone https://github.com/model-health/model-health.git

iOS Example App

A native SwiftUI app that mirrors the complete SDK workflow. It connects to the Model Health Companion app via the SDK to manage sessions, calibrate cameras and subjects, record activities, and retrieve analysis results.

Requirements

  • iOS 15.0+
  • Xcode 15.0+
  • An API key — request access if you don't have one

Configuration

1. Signing configuration

An Xcode config file is required by the project but not committed to the repository — it contains your signing credentials. A template is provided.

Copy the template and fill in your Apple Developer details:

cd examples/ios
cp LocalConfig.xcconfig.template LocalConfig.xcconfig

Edit LocalConfig.xcconfig and replace the placeholder values:

DEVELOPMENT_TEAM = YOUR_TEAM_ID
PRODUCT_BUNDLE_IDENTIFIER = com.yourcompany.ModelHealthDemo

Your Team ID can be found in Apple Developer under Membership details.

2. API key

Open ExampleConfig.swift and replace the placeholder:

enum ExampleConfig {
static let apiKey = "your_api_key_here"
}

Launch

Open the project in Xcode and run it on a connected device or simulator:

open examples/ios/ModelHealthDemo.xcodeproj

Select your target device in Xcode's toolbar and press Run (⌘R).


TypeScript Example App

A Vite web app that implements the same workflow as the iOS example in the browser. It uses the @modelhealth/modelhealth npm package and runs a local dev server.

Requirements

  • Node.js 16.0+
  • A modern browser with WebAssembly support (Chrome, Edge, Firefox, or Safari)
  • An API key — request access if you don't have one

Configuration

Copy the environment template and add your API key:

cd examples/ts
cp .env.local.template .env.local

Open .env.local and replace the placeholder:

VITE_API_KEY=your_api_key_here

Launch

Install dependencies and start the dev server:

make install
make dev

The app opens at http://localhost:5173. The dev server is also accessible on your local network at your machine's IP address — useful for testing the full workflow from a mobile device running the Model Health Companion app.


Next Steps