import a from"@contractspec/lib.ui-link";import{jsx as e,jsxs as i}from"react/jsx-runtime";function t(){return i("div",{className:"space-y-8",children:[i("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"Health Routing Strategy"}),e("p",{className:"text-muted-foreground",children:"Health integrations resolve providers through deterministic transport strategy order with explicit capability gating and unofficial-route controls."})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Connection config fields"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`{
  "defaultTransport": "official-api",
  "strategyOrder": [
    "official-api",
    "official-mcp",
    "aggregator-api",
    "aggregator-mcp",
    "unofficial"
  ],
  "allowUnofficial": false,
  "unofficialAllowList": ["health.peloton"],
  "apiBaseUrl": "https://api.provider.example",
  "mcpUrl": "https://mcp.provider.example",
  "oauthTokenUrl": "https://api.provider.example/oauth/token"
}`})})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Secret payload fields"}),e("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:e("pre",{children:`{
  "apiKey": "...",
  "accessToken": "...",
  "refreshToken": "...",
  "clientId": "...",
  "clientSecret": "...",
  "tokenExpiresAt": "2026-02-01T00:00:00.000Z",
  "mcpAccessToken": "...",
  "webhookSecret": "..."
}`})})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Routing behavior"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Unsupported strategies are skipped per provider capability matrix."}),e("li",{children:"Missing credentials fail closed and fall through only when a later strategy is valid."}),i("li",{children:["Unofficial routes are disabled unless",e("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"allowUnofficial"}),"is true."]}),i("li",{children:["When",e("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"unofficialAllowList"}),"is set, only listed provider keys can route unofficially."]}),i("li",{children:["OAuth refresh uses",e("code",{className:"ml-1 rounded bg-background/50 px-2 py-1",children:"oauthTokenUrl"}),"with refresh/client credentials when APIs return 401."]})]})]}),i("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Provider guidance"}),i("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"Use official APIs when available (Whoop, Oura, Strava, Fitbit)."}),e("li",{children:"Use aggregator routing for providers without stable official APIs (Garmin, MyFitnessPal, Eight Sleep, Peloton)."}),e("li",{children:"Keep unofficial automation opt-in and auditable for production."})]})]}),i("div",{className:"flex items-center gap-4 pt-4",children:[e(a,{href:"/docs/integrations/whatsapp-twilio",className:"btn-ghost",children:"Previous: WhatsApp Twilio"}),e(a,{href:"/docs/integrations",className:"btn-primary",children:"Back to Integrations"})]})]})}export{t as IntegrationsHealthRoutingPage};
