{"_id":"@apextelemed/survey-core","_rev":"2-272ecfd3a30891865e7f77d00fa38f74","name":"@apextelemed/survey-core","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@apextelemed/survey-core","version":"0.1.0","keywords":["apex","telemed","survey","intake","telehealth"],"license":"MIT","_id":"@apextelemed/survey-core@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/core#readme","bugs":{"url":"https://github.com/thefortifiedgrp/apex-survey-helper/issues"},"dist":{"shasum":"e242879873c2ddc75c0ca357d81cd0f51620d6b7","tarball":"https://registry.npmjs.org/@apextelemed/survey-core/-/survey-core-0.1.0.tgz","fileCount":9,"integrity":"sha512-gPJo/dqlOdnIcjN2JqIB37eKMavz/wZGBXfa7/egGgvRMjsm+2qgtRhb5AQ165A0Amh4gA721ahx6FDRGOdfbA==","signatures":[{"sig":"MEUCIBcUehuHe1u6cAlLdnwpGWNl22up099kvgcRiI5nw55TAiEAjOhUiDSxUU9jcECCvJcJ+KVOrpeHAyUfD+8jjo0hsk8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apextelemed%2fsurvey-core@0.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":187713},"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/core"},"_npmVersion":"10.8.2","description":"Framework-agnostic state machine and API client for the Apex Telemed survey-v2 embed flow.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.2","publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/survey-core_0.1.0_1787612586838_0.746405159487987","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@apextelemed/survey-core","version":"0.2.0","description":"Framework-agnostic state machine and API client 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/core"},"homepage":"https://github.com/thefortifiedgrp/apex-survey-helper/tree/main/packages/core#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","intake","telehealth"],"publishConfig":{"access":"public","provenance":true},"engines":{"node":">=18"},"gitHead":"668eeee60c8d30ddd21a721dd25b4b2834c56715","_id":"@apextelemed/survey-core@0.2.0","_nodeVersion":"24.19.0","_npmVersion":"12.0.2","dist":{"integrity":"sha512-yDooR5yjXrl13fO96NMg9CgXc8QIRoOrN6dC9YhKWIVKFTc/8chpxc1+qow9w5Q8ZG/cRM894b/DIcr3G5dMKw==","shasum":"cca4a8dc7fab3cef8a5167018c5e907a4bffc528","tarball":"https://registry.npmjs.org/@apextelemed/survey-core/-/survey-core-0.2.0.tgz","fileCount":9,"unpackedSize":189312,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@apextelemed%2fsurvey-core@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDFSs55cZNNQxa2a7umCU7wLQ+8pwLbGN8ImA/THWIN1QIgTqLrSyYIVzajqrl/YIweD++bGd5TJw8X4NDHfbEKWS8="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4d1fc8ce-8164-4ee9-9326-b8f0d7eeeda2"}},"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-core_0.2.0_1787692653159_0.41017186249316095"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-24T23:03:06.673Z","modified":"2026-08-25T21:17:33.694Z","0.1.0":"2026-08-24T23:03:06.994Z","0.2.0":"2026-08-25T21:17:33.315Z"},"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/core#readme","keywords":["apex","telemed","survey","intake","telehealth"],"repository":{"type":"git","url":"git+https://github.com/thefortifiedgrp/apex-survey-helper.git","directory":"packages/core"},"description":"Framework-agnostic state machine and API client 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-core\n\nFramework-agnostic state machine and API client for the **Apex Telemed\nsurvey-v2 embed flow**. Zero runtime dependencies. Use it directly for a\nno-framework integration, or pair it with [`@apextelemed/survey-react`](https://www.npmjs.com/package/@apextelemed/survey-react)\n/ [`@apextelemed/survey-solid`](https://www.npmjs.com/package/@apextelemed/survey-solid).\n\n```bash\nnpm install @apextelemed/survey-core\n```\n\n## Quick start\n\n```ts\nimport { createSurveyV2Engine } from '@apextelemed/survey-core';\n\nconst engine = createSurveyV2Engine({\n  apiBaseUrl: 'https://api.apextelemed.com/api',\n  publishableKey: 'pk_live_xxx',\n  drugIds: ['drug-A'],\n  onComplete: (result) => console.log('submitted', result.responseId),\n});\n\nconst unsubscribe = engine.subscribe(() => render(engine.getState()));\n// engine.setAnswer(...) / engine.next() / engine.submit() / engine.restart()\n// engine.destroy() when you tear the flow down.\n```\n\nThe engine walks a survey through these phases: `loading → questions →\npatient_info → submitting → complete` (or `disqualified` / `error`). It\npersists a draft to `localStorage` so a refresh resumes mid-flow.\n\nSee the [full docs](https://github.com/apextelemed/apex-survey-helper/tree/main/docs/partners)\n— [headless guide](https://github.com/apextelemed/apex-survey-helper/blob/main/docs/partners/headless.md),\n[auth & modes](https://github.com/apextelemed/apex-survey-helper/blob/main/docs/partners/auth-and-modes.md),\n[API contract](https://github.com/apextelemed/apex-survey-helper/blob/main/docs/partners/api-contract.md).\n\n## API surface\n\n- `createSurveyV2Engine(opts)` → `SurveyV2Engine` (`getState`, `subscribe`,\n  `setAnswer`, `setPatientInfo`, `next`, `back`, `submit`, `restart`, `destroy`)\n- `createEmbedApiClient(opts)` → low-level `EmbedApiClient`\n- `flattenComposedSurvey(survey)` → `FlatStep[]`\n- `isQuestionVisible(question, answers)` → `boolean`\n- `draftKey` / `loadDraft` / `saveDraft` / `clearDraft` — draft persistence\n- Types: `SurveyV2State`, `SurveyV2Phase`, `V2ComposedSurvey`, `V2Question`,\n  `V2QualificationResult`, `V2SubmitResult`, `PatientInfo`, …\n","readmeFilename":"README.md"}