{"_id":"@apextelemed/survey-react","_rev":"2-8e62e6834bdaf7732dd6820f2eb4ef72","name":"@apextelemed/survey-react","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@apextelemed/survey-react","version":"0.1.0","keywords":["apex","telemed","survey","react","telehealth"],"license":"MIT","_id":"@apextelemed/survey-react@0.1.0","maintainers":[{"name":"apexjoeleaver","email":"jleaver@apextelemed.com"},{"name":"smcclure_apex","email":"smcclure@apextelemed.com"}],"homepage":"https://github.com/thefortifiedgrp/apex-survey-helper/tree/main/packages/react#readme","bugs":{"url":"https://github.com/thefortifiedgrp/apex-survey-helper/issues"},"dist":{"shasum":"6657ef5b72ce1259cf0e2e58d0f82079724457ca","tarball":"https://registry.npmjs.org/@apextelemed/survey-react/-/survey-react-0.1.0.tgz","fileCount":9,"integrity":"sha512-Z3UNnCP//2TaCCHAdXL1xRUp4JGz0A3IY+d399foNCn/IAOMRpIs6U3WZA4FA2Oof71fRX6c9p98Hm3HupxwXQ==","signatures":[{"sig":"MEUCID9PTxqt7+1UQ+TBkRJPkk4IbKwjtvKPO8g4jolMZ9u0AiEA4uO6oVmfFaUKDSwEee1FmVIJbx+9/cfMt6+dEW4Xzh0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apextelemed%2fsurvey-react@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":41344},"main":"./dist/index.cjs","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","engines":{"node":">=18"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"gitHead":"c676cedf601813b36006816276f315f669146291","scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"_npmUser":{"name":"smcclure_apex","email":"smcclure@apextelemed.com"},"repository":{"url":"git+https://github.com/thefortifiedgrp/apex-survey-helper.git","type":"git","directory":"packages/react"},"_npmVersion":"10.8.2","description":"React hook for the Apex Telemed survey-v2 embed flow.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"@apextelemed/survey-core":"*"},"peerDependencies":{"react":">=18","@apextelemed/survey-core":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/survey-react_0.1.0_1787612586932_0.16417305841687657","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@apextelemed/survey-react","version":"0.2.0","description":"React hook for the Apex Telemed survey-v2 embed flow.","license":"SEE LICENSE IN LICENSE","repository":{"type":"git","url":"git+https://github.com/thefortifiedgrp/apex-survey-helper.git","directory":"packages/react"},"homepage":"https://github.com/thefortifiedgrp/apex-survey-helper/tree/main/packages/react#readme","bugs":{"url":"https://github.com/thefortifiedgrp/apex-survey-helper/issues"},"type":"module","sideEffects":false,"main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","require":"./dist/index.cjs"}},"scripts":{"build":"tsup","typecheck":"tsc --noEmit"},"keywords":["apex","telemed","survey","react","telehealth"],"peerDependencies":{"@apextelemed/survey-core":">=0.1.0 <1.0.0","react":">=18"},"devDependencies":{"@apextelemed/survey-core":"*"},"publishConfig":{"access":"public","provenance":true},"engines":{"node":">=18"},"gitHead":"668eeee60c8d30ddd21a721dd25b4b2834c56715","_id":"@apextelemed/survey-react@0.2.0","_nodeVersion":"24.19.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-9sWrvvWBqFINMnJ57a15riOvxR4rLMI3hHgrEUoZNXp6tXy3tZboJFgg3aSZofrkf8Sc7ky1trGJEa5vCuMOcA==","shasum":"abf5cf31353b9cb1f136bcc93cbc4b876a15e9c6","tarball":"https://registry.npmjs.org/@apextelemed/survey-react/-/survey-react-0.2.0.tgz","fileCount":9,"unpackedSize":42951,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apextelemed%2fsurvey-react@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDNyoqg+tBUEnaypF2dKt0Wt5QtBHbJGiZInXqFSRrjSgIhAKV9sOrLMeDP+vrDMaG9pwoVtSc9VeSADJc3V1kf+X1u"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:fcf17720-183c-4275-9b9c-f509910d62a5"}},"directories":{},"maintainers":[{"name":"apexjoeleaver","email":"jleaver@apextelemed.com"},{"name":"smcclure_apex","email":"smcclure@apextelemed.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/survey-react_0.2.0_1787692653774_0.5148005828614275"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-24T23:03:06.744Z","modified":"2026-08-25T21:17:34.255Z","0.1.0":"2026-08-24T23:03:07.052Z","0.2.0":"2026-08-25T21:17:33.918Z"},"bugs":{"url":"https://github.com/thefortifiedgrp/apex-survey-helper/issues"},"license":"SEE LICENSE IN LICENSE","homepage":"https://github.com/thefortifiedgrp/apex-survey-helper/tree/main/packages/react#readme","keywords":["apex","telemed","survey","react","telehealth"],"repository":{"type":"git","url":"git+https://github.com/thefortifiedgrp/apex-survey-helper.git","directory":"packages/react"},"description":"React hook for the Apex Telemed survey-v2 embed flow.","maintainers":[{"name":"apexjoeleaver","email":"jleaver@apextelemed.com"},{"name":"smcclure_apex","email":"smcclure@apextelemed.com"}],"readme":"# @apextelemed/survey-react\n\nReact hook for the **Apex Telemed survey-v2 embed flow**, built on\n[`@apextelemed/survey-core`](https://www.npmjs.com/package/@apextelemed/survey-core).\nHeadless — you own all markup and styling.\n\n```bash\nnpm install @apextelemed/survey-core @apextelemed/survey-react\n```\n\n`react >= 18` is a peer dependency (the hook uses `useSyncExternalStore`).\n\n## Usage\n\n```tsx\nimport { useSurveyV2Flow } from '@apextelemed/survey-react';\n\nexport function Survey() {\n  const flow = useSurveyV2Flow({\n    apiBaseUrl: 'https://api.apextelemed.com/api',\n    publishableKey: 'pk_live_xxx',\n    drugIds: ['drug-A'],\n  });\n\n  if (flow.outcome.kind === 'loading') return <p>Loading…</p>;\n  if (flow.outcome.kind === 'load_failed') return <p>Error: {flow.outcome.error}</p>;\n  if (flow.outcome.kind === 'complete') return <p>Thanks! ({flow.outcome.result.responseId})</p>;\n  if (flow.outcome.kind === 'disqualified') return <p>Not eligible.</p>;\n\n  if (flow.outcome.kind === 'patient_info') {\n    return (\n      <form onSubmit={(e) => { e.preventDefault(); flow.submit(); }}>\n        <input\n          value={flow.patientInfo.firstName ?? ''}\n          onChange={(e) => flow.setPatientInfo({ firstName: e.target.value })}\n        />\n        {/* lastName, email, dob, state … */}\n        {flow.validationError && <p role=\"alert\">{flow.validationError}</p>}\n        <button type=\"submit\" disabled={flow.submitting}>Submit</button>\n      </form>\n    );\n  }\n\n  // questions phase\n  return (\n    <div>\n      {flow.visibleQuestions.map((q) => (\n        <label key={q.questionId}>\n          {q.text}\n          <input\n            value={(flow.answers[q.questionId] as string) ?? ''}\n            onChange={(e) => flow.setAnswer(q.questionId, e.target.value)}\n          />\n        </label>\n      ))}\n      {flow.validationError && <p role=\"alert\">{flow.validationError}</p>}\n      <button onClick={flow.back} disabled={flow.stepIndex === 0}>Back</button>\n      <button onClick={flow.next} disabled={flow.submitting}>Next</button>\n    </div>\n  );\n}\n```\n\n> The engine is constructed once when the component mounts. To restart with\n> different options, remount the component (e.g. change its React `key`).\n\nSee the [React adapter docs](https://github.com/apextelemed/apex-survey-helper/blob/main/docs/partners/react.md)\nfor the full `SurveyV2Flow` shape and the\n[runnable example](https://github.com/apextelemed/apex-survey-helper/tree/main/examples/react-vite).\n","readmeFilename":"README.md"}