Docs
One call asks the patient's health app for what your visit needs and returns a cryptographically verified, validated response to your page. Everything after that — prefilling forms, writing FHIR, payment, routing — is your application's code.
Install it the way your project works
1. A module in your build (Bun, Node, Vite, anything)
Installed straight from git — pin a branch or a commit; there's no npm
registry involved. A prepare step compiles the TypeScript
on install, so you get JavaScript plus .d.ts types.
# latest on main
npm install github:smart-health-checkin/checkin-client
# pin a branch or an exact commit
npm install github:smart-health-checkin/checkin-client#main
npm install github:smart-health-checkin/checkin-client#<commit-sha>
# bun / pnpm / yarn work the same way
bun add github:smart-health-checkin/checkin-client
import { requestCheckin } from "@smart-health-checkin/checkin-client";
import { buildCheckinBundle } from "@smart-health-checkin/checkin-client/fhir";
Bun resolves the TypeScript sources directly (via the package's
bun export condition); everyone else gets the compiled
dist/ with types.
2. A script tag, no build step
The same modules, hosted here as ES modules. Use the pinned version for anything you'll link to later.
<script type="module">
import { requestCheckin } from "";
const response = await requestCheckin({ purpose: "…", items: [ … ] });
</script>
| Module | Latest | Pinned |
|---|---|---|
checkinthe protocol client |
/lib/checkin.js |
|
fhiroptional write helper |
/lib/fhir.js |
3. Read the source
It's TypeScript with no runtime dependencies — src/ is small enough to read in a sitting, and the wire layer is verified against byte-level fixtures captured from real browser sessions.
Guides
The shape of it
import { requestCheckin, CheckinFlowError } from "@smart-health-checkin/checkin-client";
try {
const response = await requestCheckin({
purpose: "Before your visit",
items: [{
id: "allergies",
title: "Allergies and intolerances",
content: {
kind: "selection.fhir",
profiles: ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance"],
},
accept: ["application/fhir+json"],
}],
});
// response.artifacts — verified, validated, yours to use
} catch (e) {
if (e instanceof CheckinFlowError && e.outcome.status === "declined") {
// the patient declined; fall back to your existing form
}
}
No platform wallet on your machine? Pass a different mediator —
createWebWalletCredentialGetter (a wallet web app in a tab,
with a real consent screen) or createMockWalletCredentialGetter
(instant, for scripted tests). Both are in the
API reference.