Skip to content

LastVet ↔ Onset — Environment Matrix

Live Onset store is onset-db / onset-api.theonset.app on R940. Hosted Supabase project refs and Railway clinic hosting are retired.

Cross-repo staging and production wiring for the veteran integration path (ADR-002: LastVet-first, OAuth-verified identity).

Quick reference

Component Staging / Dev Production
Onset iOS Debug / Onset Staging → Staging.xcconfig Release → Production.xcconfig
Onset API https://onset-api.theonset.app https://onset-api.theonset.app
Onset Clinic https://clinic.theonset.app (onset-app) same
LastVet API https://api.last.vet https://api.last.vet
LastVet OAuth client onset-ios-sandbox (legacy) / onset-ios onset-ios
Onset OAuth redirect onset://lastvet/callback onset://lastvet/callback
Last1.id OAuth (Onset link) onset://last1/callback onset://last1/callback
Veteran Onset read API GET /api/veteran/me/onset-summary same
Provider portal https://dev.provider.last.vet https://provider.last.vet
Onset feature flag lastVetIntegration ON ON
onset-web callback Cloudflare Pages preview (develop) Production Pages (main)

Onset iOS build settings

Supporting/Info.plist keys (substituted from xcconfig):

Key Staging (Staging.xcconfig) Production (Production.xcconfig)
LastVetOAuthBase https://api.last.vet https://api.last.vet
LastVetOAuthClientID onset-ios onset-ios
LastVetOAuthRedirectURI onset://lastvet/callback onset://lastvet/callback
Last1OAuthIssuer https://auth.last1.id https://auth.last1.id
Last1OAuthClientID onset onset
Last1OAuthRedirectURI onset://last1/callback onset://last1/callback

OAuth endpoints resolve to {LastVetOAuthBase}/api/v1/oauth/* and sync to {LastVetOAuthBase}/api/v1/me/sync.

Last1.id on Onset (R940 edge functions)

Secret / variable Purpose
LAST1_ID_API_BASE OIDC issuer / API base. Default https://auth.last1.id
LAST1_OAUTH_CLIENT_ID onset (last1.id system app)
LAST1_OAUTH_CLIENT_SECRET Matches ONSET_APP_SECRET on last1.id
ONSET_IDENTITY_ASSERTION_SECRET Shared with LastVet — short-lived JWT for Connect skip

Edge Functions on onset-db: last1-link, last1-unlink, last1-connect-assertion. Table: patient_last1_identities.

LastVet API

Production: https://api.last.vet. Onset iOS does not use Railway for LastVet or Clinic.

Variable Production
NODE_ENV production
LAST1_ID_API_BASE https://auth.last1.id
PROVIDER_PORTAL_URL https://provider.last.vet

Provider portal (Cloudflare Pages)

Variable Production
NEXT_PUBLIC_API_URL https://api.last.vet/api

Civilian path

Non-veterans use clinic.theonset.app (onset-app on R940) for practitioner sharing. LastVet surfaces only when lastVetIntegration is enabled and the veteran completes LastVet OAuth.