• Unified API
  • Mobile SDK
  • Connection Widget
  • Streaming
  • Lab Reports API
  • Graph API
  • Health Scores
  • Health Rewards
  • Planned Workouts
  • Lab Testing
  • AI Interface
  • Enterprise
  • Insurance
  • Integrations
  • Research
  • Podcast
  • Blog
  • Reports
  • Events
  • Documentation
  • Community
  • Example apps
  • Wearable Data
  • About
  • Customers
  • Partners
  • Careers
  • Support
  • Pricing
Terra
Pricing
Become an integrationGet started
All examples
Product
Vantage API
Platform
Web app
Repository
tryterra/terra-examples
Contributors
Alex Venetidis

In this example:

  • 01Overview
  • 02What's inside
  • 03Run it locally
  • 04Next steps
  • 05More examples
All examples

Vantage API

Terra Dispatch

Sell test kits, follow each one from order to result, and deliver FHIR results your users can act on. Every step of the Vantage kit lifecycle, in code you can lift.

Terminal
npx @tryterra/cli examples clone vantage-web-app
View on GitHubDocumentation
Terra Dispatch storefront listing standard and comprehensive blood test kits with prices and order buttons, under a demo-data banner, on a yellow background

Overview

Dispatch is a white-label diagnostics storefront with an operations console behind it. It covers the whole kit lifecycle on the Vantage API: browse a catalogue, place an order, activate a kit, track fulfilment, and deliver results with the acknowledgement step Vantage requires. It runs against the hosted sandbox with no cloud accounts to set up, and without credentials it starts in demo mode on captured sandbox data.

What's inside

  1. Storefront: catalogue browsing with the biomarkers each kit measures, at-home and in-lab ordering, and draw-site lookup.
  2. Ops console: analytics, orders, the results queue and a webhook inbox for your team.
  3. Kit activation: both the hosted flow and the programmatic API.
  4. Signed webhooks: signature verification, an inbox and delivery debugging.
  5. Results: FHIR parsing and display, plus the mandatory acknowledgement flow and escalations.
  6. Sandbox simulation: drive an order through every state without a real kit.

Run it locally

You need the Terra CLI and Node.js 20 or later. Demo mode needs nothing else. For the sandbox, you need a dev ID and API key with Vantage access, which the Terra team enables.

1. Start in demo mode

Terminal
terra examples clone vantage-web-app my-appcd my-appnpm installnpm run dev

The API runs on port 8787 and the app on 5173. Open localhost:5173 for a read-only walkthrough on captured sandbox data.

2. Connect the sandbox

Terminal
cp .env.example .env# TERRA_DEV_ID=# TERRA_API_KEY=npm run setup

Fill in both keys, then npm run setup checks your environment and names anything missing. You can now browse the live catalogue and place sandbox orders.

3. Drive an order

Place an order in /shop, then use the simulate panel in /ops to move it through collection, lab receipt and results.

4. Receive webhooks

Terminal
# TERRA_SIGNING_SECRET=npm run webhook:tunnel

Add your signing secret to .env and install the ngrok CLI. The tunnel registers its URL with Vantage, and events land in /ops/webhooks.

Next steps

Each Vantage capability lives in its own dependency-free file under src/server/lib/vantage/, so you can move them into your backend one at a time. Start with webhook-signature.ts: the HMAC covers the raw body, the timestamp is in seconds, and the comparison has to run in constant time. AGENTS.md maps what to copy and what to leave behind.

PreviousTerra PulseNextTerra Panel

More examples

  • Terra Panel patient view for Marcus Reid with an AI intelligence brief and flagged lab values for cholesterol, glucose and vitamin D, on a lavender background

    Lab Reports API

    Terra Panel

    A clinician dashboard on the Lab Reports API: upload a lab report PDF, get standardized biomarkers, and read them against the patient's wearable history.

  • Terra Grip phone screen streaming a live heart rate of 70 bpm and an R-R interval of 624 ms, each with a trend line, on a dark background

    Streaming API

    Terra Grip

    A React Native reference app for the Streaming API: pair a wearable, stream live biometrics to Terra, and render them on screen. No backend, no keys on the device.

  • Terra Basecamp health dashboard with an ask-about-your-health prompt, AI insights and daily sleep and stress scores, on a red background

    Unified API

    Terra Basecamp

    A complete Unified API integration: wearable connections, webhook ingestion, multi-device deduplication, a live dashboard, and an AI health assistant.

next ventures
pioneer fund
samsung next
y combinator
general catalyst

The world's best health apps run on Terra data

Get started
ProductsIntegrationsAI InterfaceAuthenticationMobile DevelopmentDocumentationGraphAPI
DocumentationAPISDKQuickstartExample Apps
CommunityBlogResearchCommunityPodcastAuthorsGithub
CompanyAboutCareersCustomersBecome an IntegrationCookies PolicyGDPRPrivacy PolicyTerms of Purchase
© Terra API. 2026 — All rights reserved.

Cookie Preferences

Essential CookiesAlways On
Advertisement Cookies
Analytics Cookies

Crunch Time: Embrace the Cookie Monster Within!

We use cookies to enhance your browsing experience and analyse our traffic. By clicking “Accept All”, you consent to our use of cookies according to our Cookie Policy. You can change your mind any time by visiting out cookie policy.

Cookies Policy