Docs / API reference
API reference
Every export, grouped by what you'd be doing. Signatures and types are generated from the source, so they can't drift; this page is checked at build time to make sure nothing is missing from it.
Most integrations use two: requestCheckin
and — only if you want the FHIR mapping —
buildCheckinBundle.
For explanation rather than signatures, start with
Getting started.
Run a check-in
Almost every integration is one of these two calls.
requestCheckinAsk, await, get the validated response. Throws CheckinFlowError if the flow doesn't complete.
runCheckinThe same flow, reported as a status instead of thrown — branch on completed / declined / unsupported / error.
CheckinFlowErrorCarries the outcome, so a decline can fall back gracefully.
CheckinOptionsMediator and key-custody options for either call.
CheckinOutcomeStatus, the request as sent, the response, and the failing stage if any.
Describe what you need
Build a request inline, or name one for reuse.
buildRequestComplete a request from purpose + items; fills in protocol boilerplate and validates.
registerScenarioName a request so other surfaces can refer to it.
resolveScenarioLook a registered scenario back up.
resolveRequestNormalize any accepted request input into a full request object.
SCENARIOSThe demo scenarios that ship with the library.
CheckinRequestInitThe inline shape: purpose, items, optional id and fhirVersions.
CheckinRequestInputAnything the API accepts: inline init, full request, or { scenario }.
ScenarioA named request plus its label and description.
Answer without a platform wallet
Mediators that let the whole flow run in any browser, or in a test.
createWebWalletCredentialGetterHand the request to a wallet web app in a tab — a real consent screen.
createMockWalletCredentialGetterAnswer instantly with fabricated data, for scripted tests.
WalletDeclinedErrorThrown when the person declines or closes the wallet.
WebWalletOptionsWallet URL, tab vs popup, timeout.
detectDcApiSupportWhether this browser can reach a platform wallet — checked before any prompt.
DcApiSupportSupported, or unsupported with a reason to show.
WebWalletCredentialThe credential shape a web wallet posts back.
WebWalletResponseMessageThe approve / decline / error message a web wallet sends.
WEB_WALLET_READY_MESSAGE_TYPEpostMessage type: the wallet is ready for a request.
WEB_WALLET_REQUEST_MESSAGE_TYPEpostMessage type: here is the request.
WEB_WALLET_RESPONSE_MESSAGE_TYPEpostMessage type: here is the answer.
Build a wallet (the responder side)
What the demo wallet uses; useful if you're implementing one.
parseWalletRequestRecover the check-in request from a navigator.credentials.get argument.
sealWalletResponseSign and HPKE-seal a response, bound to the verifier's origin.
fabricateResponseDemo data for a request, honouring per-item consent.
ParsedWalletRequestThe request plus the raw DeviceRequest and encryptionInfo bytes.
MockWalletOptionsOrigin, and an optional responder function.
Key custody
Where the verifier's private key lives.
createBrowserLocalAuthorityKeys in page memory — the default, demo-grade.
createServerAuthorityClient for a server that holds the keys (two-call HTTP contract).
VerifierAuthorityThe seam itself, if you want to implement your own.
PreparedCredentialRequestHandle plus the argument to pass to the browser.
CredentialCompletionThe opened response and its presentation context.
extractDcapiResponsePull the protocol payload out of a browser credential object.
Validate and inspect
The checks the library already runs — exported so you can run them yourself.
validateSmartCheckinRequestShape-check an untrusted request.
validateSmartCheckinResponseShape-check an untrusted response.
validateResponseAgainstRequestCross-check a response against the request that asked for it.
ValidationResultOk with a typed value, or an error string.
Protocol model
The wire types, if you're reading or constructing payloads directly.
SmartCheckinRequestThe request as it goes over the wire.
SmartCheckinRequestItemOne requested thing: title, selector, accepted formats.
SmartCheckinContentSelectorselection.fhir or form.fhir.
SmartCheckinResponseArtifacts plus per-item status.
SmartArtifactOne returned artifact: FHIR JSON or a SMART Health Card.
SmartArtifactBaseFields common to every artifact.
SmartCheckinItemStatusfulfilled / partial / unavailable / declined / unsupported / error.
SmartHealthCheckinAcceptedMediaTypeThe media types an item may accept.
FhirCanonicalA canonical URL, optionally with |version.
FhirProfileCollectionRefA profile family or IG canonical.
FhirResourceTypeA FHIR resource type name.
FhirVersione.g. "4.0.1".
PROTOCOL_IDThe Digital Credentials API protocol identifier.
MDOC_DOC_TYPEThe registered mdoc docType.
MDOC_NAMESPACEThe registered mdoc namespace.
SMART_REQUEST_INFO_KEYWhere the request rides inside the mdoc request.
SMART_RESPONSE_ELEMENT_IDThe element the response comes back in.
OrgIsoMdocNavigatorArgumentThe exact object passed to navigator.credentials.get.
DcapiMdocResponseThe sealed response envelope.
Write FHIR (optional module)
Imported separately from @smart-health-checkin/checkin-client/fhir — nothing in the check-in path depends on it.
buildCheckinBundleMap a response to a transaction Bundle with Provenance. Pure — no network.
postCheckinBundleSend it, in transaction or individual mode, with your own fetch if you like.
CheckinBundleThe entries and the assembled Bundle.
CheckinBundleEntryOne resource, its fullUrl, and the artifact it came from.
CheckinBundleContextPatient and appointment references to stamp — never guessed.
PostModetransaction (default) or individual.
PostResultWhat was sent and what the server said.
FetchLikeThe fetch signature, so you can inject auth.
CHECKIN_REQUEST_ID_SYSTEMIdentifier system for the check-in request id in Provenance.
CHECKIN_APPOINTMENT_SYSTEMIdentifier system for the appointment context.