[@smart-health-checkin/client API](index.md) / index

# @smart-health-checkin/client

## Classes

### CheckinFlowError

Defined in: [src/kit/index.ts:188](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L188)

Thrown by `requestCheckin` when the flow does not complete.

#### Extends

- `Error`

#### Constructors

##### Constructor

```ts
new CheckinFlowError(outcome): CheckinFlowError;
```

Defined in: [src/kit/index.ts:189](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L189)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `outcome` | [`CheckinOutcome`](#checkinoutcome) |

###### Returns

[`CheckinFlowError`](#checkinflowerror)

###### Overrides

```ts
Error.constructor
```

#### Properties

##### cause?

```ts
optional cause?: unknown;
```

Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:26

The cause of the error.

###### Inherited from

```ts
Error.cause
```

##### message

```ts
message: string;
```

Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077

###### Inherited from

```ts
Error.message
```

##### name

```ts
name: string;
```

Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1076

###### Inherited from

```ts
Error.name
```

##### outcome

```ts
readonly outcome: CheckinOutcome;
```

Defined in: [src/kit/index.ts:189](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L189)

##### stack?

```ts
optional stack?: string;
```

Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078

###### Inherited from

```ts
Error.stack
```

##### stackTraceLimit

```ts
static stackTraceLimit: number;
```

Defined in: node\_modules/@types/node/globals.d.ts:67

The `Error.stackTraceLimit` property specifies the number of stack frames
collected by a stack trace (whether generated by `new Error().stack` or
`Error.captureStackTrace(obj)`).

The default value is `10` but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

###### Inherited from

```ts
Error.stackTraceLimit
```

#### Methods

##### captureStackTrace()

###### Call Signature

```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```

Defined in: node\_modules/@types/node/globals.d.ts:51

Creates a `.stack` property on `targetObject`, which when accessed returns
a string representing the location in the code at which
`Error.captureStackTrace()` was called.

```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`
```

The first line of the trace will be prefixed with
`${myObject.name}: ${myObject.message}`.

The optional `constructorOpt` argument accepts a function. If given, all frames
above `constructorOpt`, including `constructorOpt`, will be omitted from the
generated stack trace.

The `constructorOpt` argument is useful for hiding implementation
details of error generation from the user. For instance:

```js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |

###### Returns

`void`

###### Inherited from

```ts
Error.captureStackTrace
```

###### Call Signature

```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```

Defined in: node\_modules/bun-types/globals.d.ts:1062

Create .stack property on a target object

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |

###### Returns

`void`

###### Inherited from

```ts
Error.captureStackTrace
```

##### isError()

```ts
static isError(value): value is Error;
```

Defined in: node\_modules/bun-types/globals.d.ts:1057

Check if a value is an instance of Error

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `value` | `unknown` | The value to check |

###### Returns

`value is Error`

True if the value is an instance of Error, false otherwise

###### Inherited from

```ts
Error.isError
```

##### prepareStackTrace()

```ts
static prepareStackTrace(err, stackTraces): any;
```

Defined in: node\_modules/@types/node/globals.d.ts:55

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `err` | `Error` |
| `stackTraces` | `CallSite`[] |

###### Returns

`any`

###### See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

###### Inherited from

```ts
Error.prepareStackTrace
```

***

### WalletDeclinedError

Defined in: [src/kit/web-wallet.ts:46](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L46)

Thrown when the person closes or declines in the wallet app.

#### Extends

- `Error`

#### Constructors

##### Constructor

```ts
new WalletDeclinedError(message?): WalletDeclinedError;
```

Defined in: [src/kit/web-wallet.ts:48](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L48)

###### Parameters

| Parameter | Type | Default value |
| ------ | ------ | ------ |
| `message` | `string` | `"the request was declined in the wallet"` |

###### Returns

[`WalletDeclinedError`](#walletdeclinederror)

###### Overrides

```ts
Error.constructor
```

#### Properties

##### cause?

```ts
optional cause?: unknown;
```

Defined in: node\_modules/typescript/lib/lib.es2022.error.d.ts:26

The cause of the error.

###### Inherited from

```ts
Error.cause
```

##### message

```ts
message: string;
```

Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1077

###### Inherited from

```ts
Error.message
```

##### name

```ts
readonly name: "NotAllowedError" = "NotAllowedError";
```

Defined in: [src/kit/web-wallet.ts:47](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L47)

###### Overrides

```ts
Error.name
```

##### stack?

```ts
optional stack?: string;
```

Defined in: node\_modules/typescript/lib/lib.es5.d.ts:1078

###### Inherited from

```ts
Error.stack
```

##### stackTraceLimit

```ts
static stackTraceLimit: number;
```

Defined in: node\_modules/@types/node/globals.d.ts:67

The `Error.stackTraceLimit` property specifies the number of stack frames
collected by a stack trace (whether generated by `new Error().stack` or
`Error.captureStackTrace(obj)`).

The default value is `10` but may be set to any valid JavaScript number. Changes
will affect any stack trace captured _after_ the value has been changed.

If set to a non-number value, or set to a negative number, stack traces will
not capture any frames.

###### Inherited from

```ts
Error.stackTraceLimit
```

#### Methods

##### captureStackTrace()

###### Call Signature

```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```

Defined in: node\_modules/@types/node/globals.d.ts:51

Creates a `.stack` property on `targetObject`, which when accessed returns
a string representing the location in the code at which
`Error.captureStackTrace()` was called.

```js
const myObject = {};
Error.captureStackTrace(myObject);
myObject.stack;  // Similar to `new Error().stack`
```

The first line of the trace will be prefixed with
`${myObject.name}: ${myObject.message}`.

The optional `constructorOpt` argument accepts a function. If given, all frames
above `constructorOpt`, including `constructorOpt`, will be omitted from the
generated stack trace.

The `constructorOpt` argument is useful for hiding implementation
details of error generation from the user. For instance:

```js
function a() {
  b();
}

function b() {
  c();
}

function c() {
  // Create an error without stack trace to avoid calculating the stack trace twice.
  const { stackTraceLimit } = Error;
  Error.stackTraceLimit = 0;
  const error = new Error();
  Error.stackTraceLimit = stackTraceLimit;

  // Capture the stack trace above function b
  Error.captureStackTrace(error, b); // Neither function c, nor b is included in the stack trace
  throw error;
}

a();
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |

###### Returns

`void`

###### Inherited from

```ts
Error.captureStackTrace
```

###### Call Signature

```ts
static captureStackTrace(targetObject, constructorOpt?): void;
```

Defined in: node\_modules/bun-types/globals.d.ts:1062

Create .stack property on a target object

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `targetObject` | `object` |
| `constructorOpt?` | `Function` |

###### Returns

`void`

###### Inherited from

```ts
Error.captureStackTrace
```

##### isError()

```ts
static isError(value): value is Error;
```

Defined in: node\_modules/bun-types/globals.d.ts:1057

Check if a value is an instance of Error

###### Parameters

| Parameter | Type | Description |
| ------ | ------ | ------ |
| `value` | `unknown` | The value to check |

###### Returns

`value is Error`

True if the value is an instance of Error, false otherwise

###### Inherited from

```ts
Error.isError
```

##### prepareStackTrace()

```ts
static prepareStackTrace(err, stackTraces): any;
```

Defined in: node\_modules/@types/node/globals.d.ts:55

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `err` | `Error` |
| `stackTraces` | `CallSite`[] |

###### Returns

`any`

###### See

https://v8.dev/docs/stack-trace-api#customizing-stack-traces

###### Inherited from

```ts
Error.prepareStackTrace
```

## Type Aliases

### CheckinOptions

```ts
type CheckinOptions = {
  authority?:   | "browser-local"
     | {
     server: string;
   }
     | VerifierAuthority;
  detectSupport?: typeof detectDcApiSupport;
  getCredential?: (options) => Promise<unknown>;
};
```

Defined in: [src/kit/index.ts:42](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L42)

Public barrel: the check-in protocol surface.

The library's job ends when your code has a validated SmartCheckinResponse.
FHIR writing is a separate, optional module — import it from
`./fhir/index.ts` (built as `fhir.js` on the site) if you want it.

#### Properties

##### authority?

```ts
optional authority?: 
  | "browser-local"
  | {
  server: string;
}
  | VerifierAuthority;
```

Defined in: [src/kit/index.ts:48](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L48)

Where the verifier's private key material lives. Default "browser-local"
(page memory — fine for demos); use a server-owned authority in
production.

##### detectSupport?

```ts
optional detectSupport?: typeof detectDcApiSupport;
```

Defined in: [src/kit/index.ts:56](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L56)

Test seam.

##### getCredential?

```ts
optional getCredential?: (options) => Promise<unknown>;
```

Defined in: [src/kit/index.ts:54](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L54)

The credential getter: how the flow gets the wallet's sealed answer.
Defaults to the platform Digital Credentials API;
pass a web-wallet or mock getter to run without a platform wallet.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | `unknown` |

###### Returns

`Promise`\<`unknown`\>

***

### CheckinOutcome

```ts
type CheckinOutcome = {
  error?: {
     message: string;
     stage: "prepare" | "credential" | "open" | "validate";
  };
  request: SmartCheckinRequest;
  response?: SmartCheckinResponse;
  serverReference?: string;
  status: "completed" | "declined" | "unsupported" | "error";
};
```

Defined in: [src/kit/index.ts:59](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L59)

Public barrel: the check-in protocol surface.

The library's job ends when your code has a validated SmartCheckinResponse.
FHIR writing is a separate, optional module — import it from
`./fhir/index.ts` (built as `fhir.js` on the site) if you want it.

#### Properties

##### error?

```ts
optional error?: {
  message: string;
  stage: "prepare" | "credential" | "open" | "validate";
};
```

Defined in: [src/kit/index.ts:73](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L73)

###### message

```ts
message: string;
```

###### stage

```ts
stage: "prepare" | "credential" | "open" | "validate";
```

##### request

```ts
request: SmartCheckinRequest;
```

Defined in: [src/kit/index.ts:62](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L62)

The request as sent (scenario/init resolved).

##### response?

```ts
optional response?: SmartCheckinResponse;
```

Defined in: [src/kit/index.ts:67](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L67)

The validated response — present whenever your code receives the data.
Absent only when a server-owned authority kept it (see `serverReference`).

##### serverReference?

```ts
optional serverReference?: string;
```

Defined in: [src/kit/index.ts:72](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L72)

Set when a server authority reported `handledByServer`: it holds the
data, and this is whatever handle it gave you for it.

##### status

```ts
status: "completed" | "declined" | "unsupported" | "error";
```

Defined in: [src/kit/index.ts:60](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L60)

***

### CheckinRequestInit

```ts
type CheckinRequestInit = {
  fhirVersions?: ReadonlyArray<string>;
  id?: string;
  items: ReadonlyArray<SmartCheckinRequestItem>;
  purpose?: string;
};
```

Defined in: [src/kit/scenarios.ts:22](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L22)

Everything a request needs except the boilerplate the library can fill in.

#### Properties

##### fhirVersions?

```ts
optional fhirVersions?: ReadonlyArray<string>;
```

Defined in: [src/kit/scenarios.ts:25](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L25)

##### id?

```ts
optional id?: string;
```

Defined in: [src/kit/scenarios.ts:23](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L23)

##### items

```ts
items: ReadonlyArray<SmartCheckinRequestItem>;
```

Defined in: [src/kit/scenarios.ts:26](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L26)

##### purpose?

```ts
optional purpose?: string;
```

Defined in: [src/kit/scenarios.ts:24](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L24)

***

### CheckinRequestInput

```ts
type CheckinRequestInput = 
  | SmartCheckinRequest
  | CheckinRequestInit
  | {
  scenario: string;
};
```

Defined in: [src/kit/index.ts:37](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L37)

What to ask for: an inline init, a complete request, or a registered name.

***

### CredentialCompletion

```ts
type CredentialCompletion = 
  | {
  handledByServer?: false;
  presentation: PresentationContext;
  smartResponse: SmartCheckinResponse;
}
  | {
  handledByServer: true;
  presentation?: PresentationContext;
  reference?: string;
};
```

Defined in: [src/browser/index.ts:65](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L65)

The result of opening a wallet response. Two shapes, because there are two
reasons to hold keys on a server:

- `smartResponse` — the server opened and verified it and hands the data
  back, so the page can still prefill forms. Key custody and an audit
  point, without giving up the in-page workflow.
- `handledByServer` — the server keeps the data; the page learns only that
  it succeeded. For deployments where the page must not hold PHI. In-page
  prefill is not possible in this mode, by construction.

#### Union Members

##### Type Literal

```ts
{
  handledByServer?: false;
  presentation: PresentationContext;
  smartResponse: SmartCheckinResponse;
}
```

###### handledByServer?

```ts
optional handledByServer?: false;
```

###### presentation

```ts
presentation: PresentationContext;
```

###### smartResponse

```ts
smartResponse: SmartCheckinResponse;
```

Opened and wire-verified; the caller still cross-checks it against the request.

***

##### Type Literal

```ts
{
  handledByServer: true;
  presentation?: PresentationContext;
  reference?: string;
}
```

###### handledByServer

```ts
handledByServer: true;
```

###### presentation?

```ts
optional presentation?: PresentationContext;
```

###### reference?

```ts
optional reference?: string;
```

Optional server-side handle for what it stored (an encounter id, a queue entry).

***

### DcapiMdocResponse

```ts
type DcapiMdocResponse = {
  data: {
     response: string;
  };
  protocol: typeof PROTOCOL_ID;
};
```

Defined in: [src/wire/response.ts:41](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/response.ts#L41)

#### Properties

##### data

```ts
data: {
  response: string;
};
```

Defined in: [src/wire/response.ts:43](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/response.ts#L43)

###### response

```ts
response: string;
```

##### protocol

```ts
protocol: typeof PROTOCOL_ID;
```

Defined in: [src/wire/response.ts:42](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/response.ts#L42)

***

### DcApiSupport

```ts
type DcApiSupport = 
  | {
  state: "supported";
}
  | {
  reason: string;
  state: "unsupported";
};
```

Defined in: [src/browser/index.ts:16](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L16)

***

### FetchLike

```ts
type FetchLike = (input, init?) => Promise<Response>;
```

Defined in: [src/fetch-like.ts:9](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/fetch-like.ts#L9)

The minimal fetch signature the library accepts, so callers can inject their
own client — auth headers, retries, tracing — without the library
depending on any particular one.

Lives on its own because both the check-in path and the optional FHIR
helper need it, and the check-in path must never import the FHIR module.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | `string` \| `URL` \| `Request` |
| `init?` | `RequestInit` |

#### Returns

`Promise`\<`Response`\>

***

### FhirCanonical

```ts
type FhirCanonical = string;
```

Defined in: [src/model/types.ts:6](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L6)

Transport-neutral SMART Health Check-in clinical model (draft spec §§5–6).
Ported from smart-health-checkin-mdoc rp-web/src/sdk/core.ts.

***

### FhirProfileCollectionRef

```ts
type FhirProfileCollectionRef = FhirCanonical;
```

Defined in: [src/model/types.ts:14](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L14)

***

### FhirResourceType

```ts
type FhirResourceType = string;
```

Defined in: [src/model/types.ts:8](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L8)

***

### FhirVersion

```ts
type FhirVersion = string;
```

Defined in: [src/model/types.ts:7](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L7)

***

### HandoffAnswer

```ts
type HandoffAnswer = 
  | {
  credential: {
     data: unknown;
     protocol: string;
  };
}
  | {
  declined: true;
  reason?: string;
};
```

Defined in: [src/kit/handoff.ts:34](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L34)

What the phone posts back: the wallet's credential, or a decline.

***

### HandoffEnvelope

```ts
type HandoffEnvelope = {
  createdAt: string;
  expiresAt: string;
  handoffOrigin: string;
  navigatorArgument: unknown;
  v: 1;
};
```

Defined in: [src/kit/handoff.ts:23](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L23)

What the kiosk posts for the phone to pick up.

#### Properties

##### createdAt

```ts
createdAt: string;
```

Defined in: [src/kit/handoff.ts:29](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L29)

##### expiresAt

```ts
expiresAt: string;
```

Defined in: [src/kit/handoff.ts:30](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L30)

##### handoffOrigin

```ts
handoffOrigin: string;
```

Defined in: [src/kit/handoff.ts:28](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L28)

The hand-off page's origin — the one the kiosk computed the session transcript for.

##### navigatorArgument

```ts
navigatorArgument: unknown;
```

Defined in: [src/kit/handoff.ts:26](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L26)

Passed verbatim to navigator.credentials.get on the phone.

##### v

```ts
v: 1;
```

Defined in: [src/kit/handoff.ts:24](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L24)

***

### HandoffMailbox

```ts
type HandoffMailbox = {
  answer: Promise<void>;
  fetch: Promise<HandoffEnvelope>;
  post: Promise<void>;
  waitForAnswer: Promise<HandoffAnswer>;
};
```

Defined in: [src/kit/handoff.ts:38](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L38)

#### Methods

##### answer()

```ts
answer(sessionId, answer): Promise<void>;
```

Defined in: [src/kit/handoff.ts:44](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L44)

Phone → kiosk.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `sessionId` | `string` |
| `answer` | [`HandoffAnswer`](#handoffanswer) |

###### Returns

`Promise`\<`void`\>

##### fetch()

```ts
fetch(sessionId): Promise<HandoffEnvelope>;
```

Defined in: [src/kit/handoff.ts:42](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L42)

Phone ← kiosk. Rejects if there is no such session.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `sessionId` | `string` |

###### Returns

`Promise`\<[`HandoffEnvelope`](#handoffenvelope)\>

##### post()

```ts
post(sessionId, envelope): Promise<void>;
```

Defined in: [src/kit/handoff.ts:40](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L40)

Kiosk → phone.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `sessionId` | `string` |
| `envelope` | [`HandoffEnvelope`](#handoffenvelope) |

###### Returns

`Promise`\<`void`\>

##### waitForAnswer()

```ts
waitForAnswer(sessionId, options?): Promise<HandoffAnswer>;
```

Defined in: [src/kit/handoff.ts:46](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L46)

Kiosk ← phone. Resolves with the first answer; rejects on abort.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `sessionId` | `string` |
| `options?` | \{ `signal?`: `AbortSignal`; \} |
| `options.signal?` | `AbortSignal` |

###### Returns

`Promise`\<[`HandoffAnswer`](#handoffanswer)\>

***

### HandoffOptions

```ts
type HandoffOptions = {
  handoffUrl: string;
  mailbox: HandoffMailbox;
  onWaiting?: (handoff) => void;
  sessionId?: string;
  signal?: AbortSignal;
  ttlMs?: number;
};
```

Defined in: [src/kit/handoff.ts:49](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L49)

#### Properties

##### handoffUrl

```ts
handoffUrl: string;
```

Defined in: [src/kit/handoff.ts:52](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L52)

The hand-off page the phone will open; the session id goes in its fragment.

##### mailbox

```ts
mailbox: HandoffMailbox;
```

Defined in: [src/kit/handoff.ts:50](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L50)

##### onWaiting?

```ts
optional onWaiting?: (handoff) => void;
```

Defined in: [src/kit/handoff.ts:54](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L54)

Called once the request is posted: show `url` as a QR code.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `handoff` | \{ `sessionId`: `string`; `url`: `string`; \} |
| `handoff.sessionId` | `string` |
| `handoff.url` | `string` |

###### Returns

`void`

##### sessionId?

```ts
optional sessionId?: string;
```

Defined in: [src/kit/handoff.ts:56](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L56)

Default: random.

##### signal?

```ts
optional signal?: AbortSignal;
```

Defined in: [src/kit/handoff.ts:59](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L59)

##### ttlMs?

```ts
optional ttlMs?: number;
```

Defined in: [src/kit/handoff.ts:58](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L58)

How long the phone may take to pick the request up. Default ten minutes.

***

### MockItemSpec

```ts
type MockItemSpec = 
  | {
  alsoFulfills?: readonly string[];
  fhir: unknown;
  fhirVersion?: string;
}
  | {
  alsoFulfills?: readonly string[];
  healthCard: readonly string[];
}
  | {
  message?: string;
  status: SmartCheckinItemStatus["status"];
};
```

Defined in: [src/kit/mock-wallet.ts:43](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L43)

What the mock wallet should return for one requested item.

Tests usually want to pin exact data ("this allergy list, missing its
reaction") or exercise a non-happy status, so both are first-class.

#### Union Members

##### Type Literal

```ts
{
  alsoFulfills?: readonly string[];
  fhir: unknown;
  fhirVersion?: string;
}
```

Return this FHIR resource or Bundle for the item. `alsoFulfills` names
other request items this same artifact satisfies — one bundle answering
a "clinical summary" item and an "allergies" item at once, say — and
those items are then reported fulfilled without an artifact of their own.

***

##### Type Literal

```ts
{
  alsoFulfills?: readonly string[];
  healthCard: readonly string[];
}
```

Return a SMART Health Card artifact carrying these JWS strings.

***

##### Type Literal

```ts
{
  message?: string;
  status: SmartCheckinItemStatus["status"];
}
```

Report a status with no artifact — declined, unavailable, error, …

***

### MockItemSpecs

```ts
type MockItemSpecs = 
  | MockItemSpec
  | readonly MockItemSpec[];
```

Defined in: [src/kit/mock-wallet.ts:57](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L57)

One item can be answered by several artifacts: give it a list.

***

### MockWalletOptions

```ts
type MockWalletOptions = {
  fallback?: "fabricate" | MockItemSpec;
  items?: Record<string, MockItemSpecs>;
  origin: string;
  respond?: (request) => SmartCheckinResponse;
};
```

Defined in: [src/kit/mock-wallet.ts:59](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L59)

#### Properties

##### fallback?

```ts
optional fallback?: "fabricate" | MockItemSpec;
```

Defined in: [src/kit/mock-wallet.ts:81](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L81)

What to do with items `items` doesn't mention: "fabricate" (default)
invents plausible demo data; a spec applies that spec to all of them.

##### items?

```ts
optional items?: Record<string, MockItemSpecs>;
```

Defined in: [src/kit/mock-wallet.ts:76](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L76)

Exactly what to return, per request item id. Anything not named here
follows `fallback`.

```ts
createMockWalletCredentialGetter({
  origin: location.origin,
  items: {
    allergies: { fhir: myAllergyBundle },
    coverage: { status: "declined" },
  },
  fallback: { status: "unavailable" },
});
```

##### origin

```ts
origin: string;
```

Defined in: [src/kit/mock-wallet.ts:60](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L60)

##### respond?

```ts
optional respond?: (request) => SmartCheckinResponse;
```

Defined in: [src/kit/mock-wallet.ts:83](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L83)

Full manual control: build the entire response yourself.

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `request` | [`SmartCheckinRequest`](#smartcheckinrequest) |

###### Returns

[`SmartCheckinResponse`](#smartcheckinresponse)

***

### OrgIsoMdocNavigatorArgument

```ts
type OrgIsoMdocNavigatorArgument = {
  digital: {
     requests: [{
        data: {
           deviceRequest: string;
           encryptionInfo: string;
        };
        protocol: typeof PROTOCOL_ID;
     }];
  };
  mediation: "required";
};
```

Defined in: [src/wire/request.ts:31](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L31)

#### Properties

##### digital

```ts
digital: {
  requests: [{
     data: {
        deviceRequest: string;
        encryptionInfo: string;
     };
     protocol: typeof PROTOCOL_ID;
  }];
};
```

Defined in: [src/wire/request.ts:33](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L33)

###### requests

```ts
requests: [{
  data: {
     deviceRequest: string;
     encryptionInfo: string;
  };
  protocol: typeof PROTOCOL_ID;
}];
```

##### mediation

```ts
mediation: "required";
```

Defined in: [src/wire/request.ts:32](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L32)

***

### ParsedWalletRequest

```ts
type ParsedWalletRequest = {
  deviceRequestBytes: Uint8Array;
  encryptionInfoBytes: Uint8Array;
  smartRequest: SmartCheckinRequest;
};
```

Defined in: [src/kit/mock-wallet.ts:196](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L196)

#### Properties

##### deviceRequestBytes

```ts
deviceRequestBytes: Uint8Array;
```

Defined in: [src/kit/mock-wallet.ts:198](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L198)

##### encryptionInfoBytes

```ts
encryptionInfoBytes: Uint8Array;
```

Defined in: [src/kit/mock-wallet.ts:199](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L199)

##### smartRequest

```ts
smartRequest: SmartCheckinRequest;
```

Defined in: [src/kit/mock-wallet.ts:197](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L197)

***

### PreparedCredentialRequest

```ts
type PreparedCredentialRequest = {
  handle: string;
  navigatorArgument: OrgIsoMdocNavigatorArgument;
};
```

Defined in: [src/browser/index.ts:41](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L41)

#### Properties

##### handle

```ts
handle: string;
```

Defined in: [src/browser/index.ts:43](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L43)

Opaque handle for completing the request with the same authority.

##### navigatorArgument

```ts
navigatorArgument: OrgIsoMdocNavigatorArgument;
```

Defined in: [src/browser/index.ts:45](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L45)

Pass to navigator.credentials.get(...).

***

### Responder

```ts
type Responder = {
  available: boolean;
  description?: string;
  homepage?: string;
  iconUrl?: string;
  id: string;
  isDefault: boolean;
  kind: "platform" | "web" | "mock";
  name: string;
  reason?: string;
  wallet?: WebWalletEntry;
};
```

Defined in: [src/kit/responders.ts:56](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L56)

#### Properties

##### available

```ts
available: boolean;
```

Defined in: [src/kit/responders.ts:65](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L65)

False when this browser can't use it; `reason` says why.

##### description?

```ts
optional description?: string;
```

Defined in: [src/kit/responders.ts:61](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L61)

##### homepage?

```ts
optional homepage?: string;
```

Defined in: [src/kit/responders.ts:63](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L63)

##### iconUrl?

```ts
optional iconUrl?: string;
```

Defined in: [src/kit/responders.ts:62](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L62)

##### id

```ts
id: string;
```

Defined in: [src/kit/responders.ts:58](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L58)

Stable id: "platform", "mock", or the wallet's registry id.

##### isDefault

```ts
isDefault: boolean;
```

Defined in: [src/kit/responders.ts:68](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L68)

True on exactly one responder: the one to present as the primary action.

##### kind

```ts
kind: "platform" | "web" | "mock";
```

Defined in: [src/kit/responders.ts:59](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L59)

##### name

```ts
name: string;
```

Defined in: [src/kit/responders.ts:60](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L60)

##### reason?

```ts
optional reason?: string;
```

Defined in: [src/kit/responders.ts:66](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L66)

##### wallet?

```ts
optional wallet?: WebWalletEntry;
```

Defined in: [src/kit/responders.ts:70](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L70)

The wallet entry, for `kind: "web"`.

***

### ResponderPolicy

```ts
type ResponderPolicy = {
  default?: string;
  mock?: boolean;
  origin?: string;
  platform?: boolean;
  webWallets?:   | true
     | false
     | string
     | WalletRegistry
     | WebWalletEntry[];
};
```

Defined in: [src/kit/responders.ts:24](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L24)

#### Properties

##### default?

```ts
optional default?: string;
```

Defined in: [src/kit/responders.ts:53](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L53)

Which responder the page should present as its primary action: "platform",
"mock", or a web wallet's registry id. If that one isn't available in this
browser, the first available responder is marked instead — so a page can
prefer the platform wallet and still work where there is none. Unset: the
first available.

##### mock?

```ts
optional mock?: boolean;
```

Defined in: [src/kit/responders.ts:43](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L43)

Offer the non-interactive mock. Development and demos only — never ship
a page that offers it in production.

##### origin?

```ts
optional origin?: string;
```

Defined in: [src/kit/responders.ts:45](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L45)

Verifier origin for the mock responder; defaults to this page's.

##### platform?

```ts
optional platform?: boolean;
```

Defined in: [src/kit/responders.ts:32](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L32)

Offer the person's own wallet through the Digital Credentials API.
Default true, and worth keeping on desktop: browsers that support the API
offer a cross-device flow — a QR code the person scans with their phone,
whose wallet answers, with the response returning to this page. It is
listed as unavailable, not hidden, when the browser can't reach one.

##### webWallets?

```ts
optional webWallets?: 
  | true
  | false
  | string
  | WalletRegistry
  | WebWalletEntry[];
```

Defined in: [src/kit/responders.ts:38](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L38)

Web wallets this relying party recognizes: an inline list, a registry
object, or a URL to fetch one from. `true` uses the built-in demo
registry; omit or `false` for none.

***

### Scenario

```ts
type Scenario = {
  description: string;
  label: string;
  request: SmartCheckinRequest;
};
```

Defined in: [src/kit/scenarios.ts:15](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L15)

Public barrel: the check-in protocol surface.

The library's job ends when your code has a validated SmartCheckinResponse.
FHIR writing is a separate, optional module — import it from
`./fhir/index.ts` (built as `fhir.js` on the site) if you want it.

#### Properties

##### description

```ts
description: string;
```

Defined in: [src/kit/scenarios.ts:17](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L17)

##### label

```ts
label: string;
```

Defined in: [src/kit/scenarios.ts:16](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L16)

##### request

```ts
request: SmartCheckinRequest;
```

Defined in: [src/kit/scenarios.ts:18](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L18)

***

### SmartArtifact

```ts
type SmartArtifact = 
  | SmartArtifactBase & {
  mediaType: "application/smart-health-card";
  value: {
     verifiableCredential: ReadonlyArray<string>;
  };
}
  | SmartArtifactBase & {
  fhirVersion: FhirVersion;
  mediaType: "application/fhir+json";
  value: unknown;
};
```

Defined in: [src/model/types.ts:59](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L59)

***

### SmartArtifactBase

```ts
type SmartArtifactBase = {
  fulfills: ReadonlyArray<string>;
  id: string;
  mediaType: string;
};
```

Defined in: [src/model/types.ts:53](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L53)

#### Properties

##### fulfills

```ts
fulfills: ReadonlyArray<string>;
```

Defined in: [src/model/types.ts:56](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L56)

##### id

```ts
id: string;
```

Defined in: [src/model/types.ts:54](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L54)

##### mediaType

```ts
mediaType: string;
```

Defined in: [src/model/types.ts:55](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L55)

***

### SmartCheckinContentSelector

```ts
type SmartCheckinContentSelector = 
  | {
  kind: "selection.fhir";
  profiles?: ReadonlyArray<FhirCanonical>;
  profilesFrom?: ReadonlyArray<FhirProfileCollectionRef>;
  resourceTypes?: ReadonlyArray<FhirResourceType>;
}
  | {
  kind: "form.fhir";
  questionnaire?: unknown;
  questionnaireCanonical?: FhirCanonical;
};
```

Defined in: [src/model/types.ts:16](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L16)

***

### SmartCheckinItemStatus

```ts
type SmartCheckinItemStatus = {
  item: string;
  message?: string;
  status:   | "fulfilled"
     | "partial"
     | "unavailable"
     | "declined"
     | "unsupported"
     | "error";
};
```

Defined in: [src/model/types.ts:47](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L47)

#### Properties

##### item

```ts
item: string;
```

Defined in: [src/model/types.ts:48](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L48)

##### message?

```ts
optional message?: string;
```

Defined in: [src/model/types.ts:50](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L50)

##### status

```ts
status: 
  | "fulfilled"
  | "partial"
  | "unavailable"
  | "declined"
  | "unsupported"
  | "error";
```

Defined in: [src/model/types.ts:49](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L49)

***

### SmartCheckinRequest

```ts
type SmartCheckinRequest = {
  fhirVersions?: ReadonlyArray<FhirVersion>;
  id: string;
  items: ReadonlyArray<SmartCheckinRequestItem>;
  purpose?: string;
  type: "smart-health-checkin-request";
  version: "1";
};
```

Defined in: [src/model/types.ts:38](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L38)

#### Properties

##### fhirVersions?

```ts
optional fhirVersions?: ReadonlyArray<FhirVersion>;
```

Defined in: [src/model/types.ts:43](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L43)

##### id

```ts
id: string;
```

Defined in: [src/model/types.ts:41](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L41)

##### items

```ts
items: ReadonlyArray<SmartCheckinRequestItem>;
```

Defined in: [src/model/types.ts:44](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L44)

##### purpose?

```ts
optional purpose?: string;
```

Defined in: [src/model/types.ts:42](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L42)

##### type

```ts
type: "smart-health-checkin-request";
```

Defined in: [src/model/types.ts:39](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L39)

##### version

```ts
version: "1";
```

Defined in: [src/model/types.ts:40](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L40)

***

### SmartCheckinRequestItem

```ts
type SmartCheckinRequestItem = {
  accept: ReadonlyArray<SmartHealthCheckinAcceptedMediaType>;
  content: SmartCheckinContentSelector;
  id: string;
  required?: boolean;
  summary?: string;
  title: string;
};
```

Defined in: [src/model/types.ts:29](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L29)

#### Properties

##### accept

```ts
accept: ReadonlyArray<SmartHealthCheckinAcceptedMediaType>;
```

Defined in: [src/model/types.ts:35](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L35)

##### content

```ts
content: SmartCheckinContentSelector;
```

Defined in: [src/model/types.ts:34](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L34)

##### id

```ts
id: string;
```

Defined in: [src/model/types.ts:30](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L30)

##### required?

```ts
optional required?: boolean;
```

Defined in: [src/model/types.ts:33](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L33)

##### summary?

```ts
optional summary?: string;
```

Defined in: [src/model/types.ts:32](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L32)

##### title

```ts
title: string;
```

Defined in: [src/model/types.ts:31](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L31)

***

### SmartCheckinResponse

```ts
type SmartCheckinResponse = {
  artifacts: ReadonlyArray<SmartArtifact>;
  requestId: string;
  requestStatus: ReadonlyArray<SmartCheckinItemStatus>;
  type: "smart-health-checkin-response";
  version: "1";
};
```

Defined in: [src/model/types.ts:70](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L70)

#### Properties

##### artifacts

```ts
artifacts: ReadonlyArray<SmartArtifact>;
```

Defined in: [src/model/types.ts:74](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L74)

##### requestId

```ts
requestId: string;
```

Defined in: [src/model/types.ts:73](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L73)

##### requestStatus

```ts
requestStatus: ReadonlyArray<SmartCheckinItemStatus>;
```

Defined in: [src/model/types.ts:75](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L75)

##### type

```ts
type: "smart-health-checkin-response";
```

Defined in: [src/model/types.ts:71](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L71)

##### version

```ts
version: "1";
```

Defined in: [src/model/types.ts:72](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L72)

***

### SmartHealthCheckinAcceptedMediaType

```ts
type SmartHealthCheckinAcceptedMediaType = 
  | "application/smart-health-card"
  | "application/fhir+json"
  | string & {
};
```

Defined in: [src/model/types.ts:9](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L9)

***

### ValidationResult

```ts
type ValidationResult<T> = 
  | {
  ok: true;
  value: T;
}
  | {
  error: string;
  ok: false;
};
```

Defined in: [src/model/types.ts:78](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/types.ts#L78)

#### Type Parameters

| Type Parameter |
| ------ |
| `T` |

***

### VerifierAuthority

```ts
type VerifierAuthority = {
  kind: string;
  completeCredentialRequest: Promise<CredentialCompletion>;
  prepareCredentialRequest: Promise<PreparedCredentialRequest>;
};
```

Defined in: [src/browser/index.ts:90](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L90)

The key-custody seam.

browser-local — the default — generates an ephemeral, single-use HPKE key
in the page. That is the intended arrangement: the page must be able to
read the response for prefill workflows, and keeping the client
browser-only means no per-language server SDK has to exist.

A server-owned implementation keeps the key behind two HTTP calls for
deployments that specifically don't want the page to hold the response.

#### Properties

##### kind

```ts
kind: string;
```

Defined in: [src/browser/index.ts:91](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L91)

#### Methods

##### completeCredentialRequest()

```ts
completeCredentialRequest(input): Promise<CredentialCompletion>;
```

Defined in: [src/browser/index.ts:93](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L93)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `credential`: `unknown`; `handle`: `string`; \} |
| `input.credential` | `unknown` |
| `input.handle` | `string` |

###### Returns

`Promise`\<[`CredentialCompletion`](#credentialcompletion)\>

##### prepareCredentialRequest()

```ts
prepareCredentialRequest(input): Promise<PreparedCredentialRequest>;
```

Defined in: [src/browser/index.ts:92](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L92)

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `request`: [`SmartCheckinRequest`](#smartcheckinrequest); \} |
| `input.request` | [`SmartCheckinRequest`](#smartcheckinrequest) |

###### Returns

`Promise`\<[`PreparedCredentialRequest`](#preparedcredentialrequest)\>

***

### WalletRegistry

```ts
type WalletRegistry = {
  source?: string;
  wallets: WebWalletEntry[];
};
```

Defined in: [src/kit/wallet-registry.ts:34](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L34)

#### Properties

##### source?

```ts
optional source?: string;
```

Defined in: [src/kit/wallet-registry.ts:36](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L36)

Free-form label for where this list came from.

##### wallets

```ts
wallets: WebWalletEntry[];
```

Defined in: [src/kit/wallet-registry.ts:37](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L37)

***

### WebWalletCredential

```ts
type WebWalletCredential = {
  data: object;
  protocol: string;
};
```

Defined in: [src/kit/web-wallet.ts:20](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L20)

#### Properties

##### data

```ts
data: object;
```

Defined in: [src/kit/web-wallet.ts:20](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L20)

##### protocol

```ts
protocol: string;
```

Defined in: [src/kit/web-wallet.ts:20](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L20)

***

### WebWalletEntry

```ts
type WebWalletEntry = {
  description?: string;
  homepage?: string;
  iconUrl?: string;
  id: string;
  name: string;
  target?: "tab" | "popup";
  walletUrl: string;
};
```

Defined in: [src/kit/wallet-registry.ts:17](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L17)

#### Properties

##### description?

```ts
optional description?: string;
```

Defined in: [src/kit/wallet-registry.ts:25](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L25)

One line for a picker menu.

##### homepage?

```ts
optional homepage?: string;
```

Defined in: [src/kit/wallet-registry.ts:29](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L29)

Where to learn about or install the wallet.

##### iconUrl?

```ts
optional iconUrl?: string;
```

Defined in: [src/kit/wallet-registry.ts:27](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L27)

Icon for a picker menu; must be same-origin or CORS-readable.

##### id

```ts
id: string;
```

Defined in: [src/kit/wallet-registry.ts:19](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L19)

Stable identifier used in URLs, storage, and telemetry.

##### name

```ts
name: string;
```

Defined in: [src/kit/wallet-registry.ts:21](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L21)

What the person sees: "Demo Health Wallet".

##### target?

```ts
optional target?: "tab" | "popup";
```

Defined in: [src/kit/wallet-registry.ts:31](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L31)

Open in a tab (default) or a popup window.

##### walletUrl

```ts
walletUrl: string;
```

Defined in: [src/kit/wallet-registry.ts:23](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L23)

The page that answers check-in requests.

***

### WebWalletOptions

```ts
type WebWalletOptions = {
  features?: string;
  target?: "tab" | "popup";
  timeoutMs?: number;
  walletUrl: string;
};
```

Defined in: [src/kit/web-wallet.ts:27](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L27)

#### Properties

##### features?

```ts
optional features?: string;
```

Defined in: [src/kit/web-wallet.ts:40](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L40)

Explicit window.open features string; implies a popup.

##### target?

```ts
optional target?: "tab" | "popup";
```

Defined in: [src/kit/web-wallet.ts:38](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L38)

How to open the wallet. "tab" (default) opens a normal browser tab, which
behaves better on mobile and in browsers that resist popups; "popup"
opens a small window. Ignored if `features` is set.

##### timeoutMs?

```ts
optional timeoutMs?: number;
```

Defined in: [src/kit/web-wallet.ts:42](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L42)

Give up after this many ms (default 5 minutes).

##### walletUrl

```ts
walletUrl: string;
```

Defined in: [src/kit/web-wallet.ts:32](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L32)

URL of the wallet web app (same-origin or any origin you trust). Usually
comes from a registry entry — see `resolveResponders`.

***

### WebWalletResponseMessage

```ts
type WebWalletResponseMessage = 
  | {
  credential: WebWalletCredential;
  outcome: "approved";
  requestId?: string;
  type: typeof WEB_WALLET_RESPONSE_MESSAGE_TYPE;
}
  | {
  outcome: "declined" | "closed";
  requestId?: string;
  type: typeof WEB_WALLET_RESPONSE_MESSAGE_TYPE;
}
  | {
  message: string;
  outcome: "error";
  requestId?: string;
  type: typeof WEB_WALLET_RESPONSE_MESSAGE_TYPE;
};
```

Defined in: [src/kit/web-wallet.ts:22](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L22)

## Variables

### DEMO\_HEALTH\_CARD\_JWS

```ts
const DEMO_HEALTH_CARD_JWS: "eyJ6aXAiOiJERUYiLCJhbGciOiJFUzI1NiIsImtpZCI6Im1vY2sta2V5In0.fZHNjtQwEIRfZVVcnZkkGmbAR1gkQFqB-Lus5tBxOhsjx4nszrBR5HdHDquBw4pj293V9VWvsDFCoxeZot7vf5FzLDt-pGFyvG95GKHgmw66Oh1Pdf3yWJYKFwO9QpaJoe-vw3GgID2Tk35nKLTxxZ-iyAXOCiZwy14sua9z85ONZJWut-EHh2hHD43DrtxVUNvrm9m3jnNP4DjOwfC3bSOePtSTA5jROTaSFRTYS1ig71d0s3Pfg4O-zusS6lo8I_yZxLKXjExDZlvR0WDdAo0vvHCEwoO9sM_YH8fQksc5nRUaG6S_Jcki1etXh6I8FmWNlNSzNjLhf2y8HS8c6CETRiGZ84XIiL38ZV4h_CjQuOVhvHm_5XwzOfJICnFuogm24fChzS3v7j4Vh0N1gkLDnjtrLOWM8uKOA_vs4t-QksJEyxi2BFobJ0c5gm3X3SwzOWTqiYMd26wThUJ2U5f1sSiroqyQUjqnlNJv.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" = "eyJ6aXAiOiJERUYiLCJhbGciOiJFUzI1NiIsImtpZCI6Im1vY2sta2V5In0.fZHNjtQwEIRfZVVcnZkkGmbAR1gkQFqB-Lus5tBxOhsjx4nszrBR5HdHDquBw4pj293V9VWvsDFCoxeZot7vf5FzLDt-pGFyvG95GKHgmw66Oh1Pdf3yWJYKFwO9QpaJoe-vw3GgID2Tk35nKLTxxZ-iyAXOCiZwy14sua9z85ONZJWut-EHh2hHD43DrtxVUNvrm9m3jnNP4DjOwfC3bSOePtSTA5jROTaSFRTYS1ig71d0s3Pfg4O-zusS6lo8I_yZxLKXjExDZlvR0WDdAo0vvHCEwoO9sM_YH8fQksc5nRUaG6S_Jcki1etXh6I8FmWNlNSzNjLhf2y8HS8c6CETRiGZ84XIiL38ZV4h_CjQuOVhvHm_5XwzOfJICnFuogm24fChzS3v7j4Vh0N1gkLDnjtrLOWM8uKOA_vs4t-QksJEyxi2BFobJ0c5gm3X3SwzOWTqiYMd26wThUJ2U5f1sSiroqyQUjqnlNJv.AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA";
```

Defined in: [src/kit/mock-wallet.ts:299](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L299)

A structurally real SMART Health Card: a JWS whose payload is the raw-DEFLATEd
`{ iss, nbf, vc.credentialSubject.fhirBundle }` (one Patient, one Coverage),
so anything that decodes cards can show what is in it. The signature is
zeros — nothing verifies it, and nothing should.

***

### DEMO\_WALLET\_REGISTRY

```ts
const DEMO_WALLET_REGISTRY: WalletRegistry;
```

Defined in: [src/kit/wallet-registry.ts:41](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L41)

The list every deployment starts with: this project's demo wallet.

***

### MDOC\_DOC\_TYPE

```ts
const MDOC_DOC_TYPE: "org.smarthealthit.checkin.1";
```

Defined in: [src/wire/request.ts:25](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L25)

***

### MDOC\_NAMESPACE

```ts
const MDOC_NAMESPACE: "org.smarthealthit.checkin";
```

Defined in: [src/wire/request.ts:26](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L26)

***

### PROTOCOL\_ID

```ts
const PROTOCOL_ID: "org-iso-mdoc";
```

Defined in: [src/wire/request.ts:24](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L24)

***

### SCENARIOS

```ts
const SCENARIOS: Record<string, Scenario>;
```

Defined in: [src/kit/scenarios.ts:74](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L74)

Public barrel: the check-in protocol surface.

The library's job ends when your code has a validated SmartCheckinResponse.
FHIR writing is a separate, optional module — import it from
`./fhir/index.ts` (built as `fhir.js` on the site) if you want it.

***

### SMART\_REQUEST\_INFO\_KEY

```ts
const SMART_REQUEST_INFO_KEY: "org.smarthealthit.checkin.request";
```

Defined in: [src/wire/request.ts:27](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L27)

***

### SMART\_RESPONSE\_ELEMENT\_ID

```ts
const SMART_RESPONSE_ELEMENT_ID: "smart_health_checkin_response";
```

Defined in: [src/wire/request.ts:28](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L28)

***

### WEB\_WALLET\_READY\_MESSAGE\_TYPE

```ts
const WEB_WALLET_READY_MESSAGE_TYPE: "digital-credentials/web-wallet/ready";
```

Defined in: [src/kit/web-wallet.ts:18](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L18)

***

### WEB\_WALLET\_REQUEST\_MESSAGE\_TYPE

```ts
const WEB_WALLET_REQUEST_MESSAGE_TYPE: "digital-credentials/web-wallet/request";
```

Defined in: [src/kit/web-wallet.ts:16](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L16)

Web-wallet credential getter: a drop-in replacement for
`navigator.credentials.get` that hands the request to a wallet **web app**
in another tab (or a popup) over postMessage, and waits for the sealed
response.

This exists so the whole flow — including a real consent screen where the
person chooses what to share — can be demonstrated on any browser, with no
platform wallet and no phone. The wire format is identical to the platform
Digital Credentials API path; only the credential getter differs.

Message types match the web-wallet sketch in the spec prototype so the two
implementations stay compatible.

***

### WEB\_WALLET\_RESPONSE\_MESSAGE\_TYPE

```ts
const WEB_WALLET_RESPONSE_MESSAGE_TYPE: "digital-credentials/web-wallet/response";
```

Defined in: [src/kit/web-wallet.ts:17](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L17)

## Functions

### answerHandoff()

```ts
function answerHandoff(
   mailbox, 
   sessionId, 
   envelope, 
getCredential?): Promise<HandoffAnswer>;
```

Defined in: [src/kit/handoff.ts:146](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L146)

Phone side, step two: ask the wallet and send back what it returned.
`getCredential` defaults to the browser's own navigator.credentials.get;
pass a web-wallet or mock getter to answer without a platform wallet. A
decline is reported to the kiosk as a decline, not as silence.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `mailbox` | [`HandoffMailbox`](#handoffmailbox) |
| `sessionId` | `string` |
| `envelope` | [`HandoffEnvelope`](#handoffenvelope) |
| `getCredential` | (`navigatorArgument`) => `Promise`\<`unknown`\> |

#### Returns

`Promise`\<[`HandoffAnswer`](#handoffanswer)\>

***

### buildDcapiSessionTranscript()

```ts
function buildDcapiSessionTranscript(input): Promise<Uint8Array<ArrayBufferLike>>;
```

Defined in: [src/wire/request.ts:258](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L258)

SessionTranscript (spec §8.3) — both verifier and wallet compute this
identically:
  dcapiInfo = CBOR([encryptionInfoBase64Url, origin])
  handover  = ["dcapi", SHA-256(dcapiInfo)]
  SessionTranscript = CBOR([null, null, handover])

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `encryptionInfo`: `string` \| `Uint8Array`\<`ArrayBufferLike`\>; `origin`: `string`; \} |
| `input.encryptionInfo` | `string` \| `Uint8Array`\<`ArrayBufferLike`\> |
| `input.origin` | `string` |

#### Returns

`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>

***

### buildMockResponse()

```ts
function buildMockResponse(request, options?): SmartCheckinResponse;
```

Defined in: [src/kit/mock-wallet.ts:90](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L90)

Build a response from a per-item specification. Exported so tests can
assert on the response without going through the wire layer at all.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `request` | [`SmartCheckinRequest`](#smartcheckinrequest) |
| `options` | `Pick`\<[`MockWalletOptions`](#mockwalletoptions), `"items"` \| `"fallback"`\> |

#### Returns

[`SmartCheckinResponse`](#smartcheckinresponse)

***

### buildOrgIsoMdocRequest()

```ts
function buildOrgIsoMdocRequest(smartRequest, options?): Promise<OrgIsoMdocRequestBundle>;
```

Defined in: [src/wire/request.ts:63](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/request.ts#L63)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `smartRequest` | [`SmartCheckinRequest`](#smartcheckinrequest) |
| `options` | \{ `deviceRequestVersion?`: `"1.0"` \| `"1.1"`; `includeCompanionElement?`: `boolean`; `nonce?`: `Uint8Array`\<`ArrayBufferLike`\>; `origin?`: `string`; `readerAuth?`: `boolean`; `readerIdentity?`: `ReaderIdentity`; `responseElementIdentifier?`: `string`; `verifierKeyPair?`: `CryptoKeyPair`; \} |
| `options.deviceRequestVersion?` | `"1.0"` \| `"1.1"` |
| `options.includeCompanionElement?` | `boolean` |
| `options.nonce?` | `Uint8Array`\<`ArrayBufferLike`\> |
| `options.origin?` | `string` |
| `options.readerAuth?` | `boolean` |
| `options.readerIdentity?` | `ReaderIdentity` |
| `options.responseElementIdentifier?` | `string` |
| `options.verifierKeyPair?` | `CryptoKeyPair` |

#### Returns

`Promise`\<`OrgIsoMdocRequestBundle`\>

***

### buildRequest()

```ts
function buildRequest(init): SmartCheckinRequest;
```

Defined in: [src/kit/scenarios.ts:34](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L34)

Complete a request from the parts an integrator actually cares about:
`type`/`version` are fixed by the spec, `id` defaults to a UUID, and
`fhirVersions` defaults to ["4.0.1"]. Validates before returning.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `init` | [`CheckinRequestInit`](#checkinrequestinit) |

#### Returns

[`SmartCheckinRequest`](#smartcheckinrequest)

***

### createBrowserLocalAuthority()

```ts
function createBrowserLocalAuthority(options?): VerifierAuthority;
```

Defined in: [src/browser/index.ts:103](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L103)

Ephemeral, single-use verifier key held in the page. The default.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | \{ `origin?`: `string`; \} |
| `options.origin?` | `string` |

#### Returns

[`VerifierAuthority`](#verifierauthority)

***

### createHandoff()

```ts
function createHandoff(options): {
  authority: VerifierAuthority;
  getCredential: (navigatorArgument) => Promise<unknown>;
};
```

Defined in: [src/kit/handoff.ts:120](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L120)

Everything a kiosk passes to `runCheckin` / `requestCheckin`:

```ts
const outcome = await runCheckin(request, createHandoff({
  mailbox, handoffUrl: "/handoff.html",
  onWaiting: ({ url }) => drawQr(url),
}));
```

The key lives in this page, as usual; the session transcript is computed
for the hand-off page's origin, because that is where the wallet will be
asked.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | [`HandoffOptions`](#handoffoptions) |

#### Returns

```ts
{
  authority: VerifierAuthority;
  getCredential: (navigatorArgument) => Promise<unknown>;
}
```

##### authority

```ts
authority: VerifierAuthority;
```

##### getCredential

```ts
getCredential: (navigatorArgument) => Promise<unknown>;
```

###### Parameters

| Parameter | Type |
| ------ | ------ |
| `navigatorArgument` | `unknown` |

###### Returns

`Promise`\<`unknown`\>

***

### createHandoffCredentialGetter()

```ts
function createHandoffCredentialGetter(options): (navigatorArgument) => Promise<unknown>;
```

Defined in: [src/kit/handoff.ts:86](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L86)

The `getCredential` for a kiosk: posts the request, shows the QR, waits.
Pair it with an authority built for the hand-off page's origin — or use
`createHandoff`, which does both.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | [`HandoffOptions`](#handoffoptions) |

#### Returns

(`navigatorArgument`) => `Promise`\<`unknown`\>

***

### createMockWalletCredentialGetter()

```ts
function createMockWalletCredentialGetter(options): (navigatorArgument) => Promise<unknown>;
```

Defined in: [src/kit/mock-wallet.ts:179](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L179)

A drop-in `getCredential` hook for runCheckin: parses the navigator
argument the same way a platform wallet would and returns a credential-like
object carrying the sealed response.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | [`MockWalletOptions`](#mockwalletoptions) |

#### Returns

(`navigatorArgument`) => `Promise`\<`unknown`\>

***

### createServerAuthority()

```ts
function createServerAuthority(baseUrl): VerifierAuthority;
```

Defined in: [src/browser/index.ts:166](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L166)

HTTP client for a server-owned authority. Two calls, JSON both ways:

  POST {base}/credential-requests
    → { "request": SmartCheckinRequest }
    ← { "handle": string, "navigatorArgument": {...} }

  POST {base}/credential-requests/{handle}/complete
    → { "credential": <what navigator.credentials.get returned> }
    ← { "smartResponse": {...}, "presentation": {...} }
      or { "handledByServer": true, "reference"?: string }

Requests carry the page's credentials (`credentials: "include"`), so the
server can bind a check-in to the authenticated session. The full contract,
including what the server must store and verify, is in
docs/server-authority.md.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `baseUrl` | `string` |

#### Returns

[`VerifierAuthority`](#verifierauthority)

***

### createWebWalletCredentialGetter()

```ts
function createWebWalletCredentialGetter(options): (navigatorArgument) => Promise<unknown>;
```

Defined in: [src/kit/web-wallet.ts:53](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/web-wallet.ts#L53)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `options` | [`WebWalletOptions`](#webwalletoptions) |

#### Returns

(`navigatorArgument`) => `Promise`\<`unknown`\>

***

### credentialGetterFor()

```ts
function credentialGetterFor(responder, options?): ((navigatorArgument) => Promise<unknown>) | undefined;
```

Defined in: [src/kit/responders.ts:148](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L148)

The `getCredential` to pass to `requestCheckin` / `runCheckin` for a chosen
responder. Returns undefined for the platform option, which is the default
path and needs no override.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `responder` | [`Responder`](#responder) |
| `options` | \{ `origin?`: `string`; \} |
| `options.origin?` | `string` |

#### Returns

((`navigatorArgument`) => `Promise`\<`unknown`\>) \| `undefined`

***

### detectDcApiSupport()

```ts
function detectDcApiSupport(): DcApiSupport;
```

Defined in: [src/browser/index.ts:20](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L20)

#### Returns

[`DcApiSupport`](#dcapisupport)

***

### extractDcapiResponse()

```ts
function extractDcapiResponse(credential): string | DcapiMdocResponse;
```

Defined in: [src/browser/index.ts:201](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/browser/index.ts#L201)

Pull the org-iso-mdoc response payload out of whatever the browser's
credential object looks like: a DigitalCredential with `.data` (object or
JSON string), a bare `{protocol, data}` object, or the raw base64url
response string.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `credential` | `unknown` |

#### Returns

`string` \| [`DcapiMdocResponse`](#dcapimdocresponse)

***

### fabricateResponse()

```ts
function fabricateResponse(request, include?): SmartCheckinResponse;
```

Defined in: [src/kit/mock-wallet.ts:302](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L302)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `request` | [`SmartCheckinRequest`](#smartcheckinrequest) |
| `include?` | (`itemId`) => `boolean` |

#### Returns

[`SmartCheckinResponse`](#smartcheckinresponse)

***

### fetchHandoff()

```ts
function fetchHandoff(mailbox, sessionId): Promise<{
  envelope: HandoffEnvelope;
  request: SmartCheckinRequest;
}>;
```

Defined in: [src/kit/handoff.ts:131](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L131)

Phone side, step one: pick the request up and recover what it asks for, to show the person.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `mailbox` | [`HandoffMailbox`](#handoffmailbox) |
| `sessionId` | `string` |

#### Returns

`Promise`\<\{
  `envelope`: [`HandoffEnvelope`](#handoffenvelope);
  `request`: [`SmartCheckinRequest`](#smartcheckinrequest);
\}\>

***

### findWallet()

```ts
function findWallet(registry, id): WebWalletEntry | undefined;
```

Defined in: [src/kit/wallet-registry.ts:126](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L126)

Look one up by id.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `registry` | [`WalletRegistry`](#walletregistry) |
| `id` | `string` |

#### Returns

[`WebWalletEntry`](#webwalletentry) \| `undefined`

***

### handoffUrlFor()

```ts
function handoffUrlFor(handoffUrl, sessionId): string;
```

Defined in: [src/kit/handoff.ts:65](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L65)

The URL the QR code carries.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `handoffUrl` | `string` |
| `sessionId` | `string` |

#### Returns

`string`

***

### loadWalletRegistry()

```ts
function loadWalletRegistry(source?, options?): Promise<WalletRegistry>;
```

Defined in: [src/kit/wallet-registry.ts:96](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L96)

Resolve a registry from whatever a deployment configured: the built-in
default, an inline object or array, or a URL to fetch JSON from.

```ts
const registry = await loadWalletRegistry("/config/wallets.json");
```

A fetched list is validated before use; a malformed one throws rather than
silently falling back, because "which wallet are we sending people to" is
not a question to answer by accident.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `source?` | \| `string` \| [`WebWalletEntry`](#webwalletentry)[] \| [`WalletRegistry`](#walletregistry) |
| `options?` | \{ `fetchImpl?`: [`FetchLike`](#fetchlike); \} |
| `options.fetchImpl?` | [`FetchLike`](#fetchlike) |

#### Returns

`Promise`\<[`WalletRegistry`](#walletregistry)\>

***

### openWalletResponse()

```ts
function openWalletResponse(input): Promise<OpenWalletResponseResult>;
```

Defined in: [src/wire/response.ts:206](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/response.ts#L206)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `aad?`: `Uint8Array`\<`ArrayBufferLike`\>; `recipientPrivateKey`: `CryptoKey`; `recipientPublicJwk`: `JsonWebKey`; `response`: `string` \| [`DcapiMdocResponse`](#dcapimdocresponse); `sessionTranscript`: `Uint8Array`; `smartRequest?`: `unknown`; \} |
| `input.aad?` | `Uint8Array`\<`ArrayBufferLike`\> |
| `input.recipientPrivateKey` | `CryptoKey` |
| `input.recipientPublicJwk` | `JsonWebKey` |
| `input.response` | `string` \| [`DcapiMdocResponse`](#dcapimdocresponse) |
| `input.sessionTranscript` | `Uint8Array` |
| `input.smartRequest?` | `unknown` |

#### Returns

`Promise`\<`OpenWalletResponseResult`\>

***

### parseWalletRequest()

```ts
function parseWalletRequest(navigatorArgument): ParsedWalletRequest;
```

Defined in: [src/kit/mock-wallet.ts:203](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L203)

Wallet side: recover the SMART request from a navigator.credentials.get argument.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `navigatorArgument` | `unknown` |

#### Returns

[`ParsedWalletRequest`](#parsedwalletrequest)

***

### registerScenario()

```ts
function registerScenario(
   key, 
   request, 
   meta?): Scenario;
```

Defined in: [src/kit/scenarios.ts:52](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L52)

Register (or replace) a named scenario — lets declarative surfaces like
<smart-checkin scenario="my-intake"> use requests your code defines.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `string` |
| `request` | \| [`SmartCheckinRequest`](#smartcheckinrequest) \| [`CheckinRequestInit`](#checkinrequestinit) |
| `meta` | \{ `description?`: `string`; `label?`: `string`; \} |
| `meta.description?` | `string` |
| `meta.label?` | `string` |

#### Returns

[`Scenario`](#scenario)

***

### requestCheckin()

```ts
function requestCheckin(input, options?): Promise<SmartCheckinResponse>;
```

Defined in: [src/kit/index.ts:207](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L207)

Ask, await, use the answer:

  const response = await requestCheckin({ purpose: "…", items: [ … ] });

Returns the validated response, or throws CheckinFlowError (which carries
the outcome, so you can fall back gracefully on "declined").

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | [`CheckinRequestInput`](#checkinrequestinput) |
| `options` | [`CheckinOptions`](#checkinoptions) |

#### Returns

`Promise`\<[`SmartCheckinResponse`](#smartcheckinresponse)\>

***

### resolveRequest()

```ts
function resolveRequest(input): SmartCheckinRequest;
```

Defined in: [src/kit/index.ts:79](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L79)

Public barrel: the check-in protocol surface.

The library's job ends when your code has a validated SmartCheckinResponse.
FHIR writing is a separate, optional module — import it from
`./fhir/index.ts` (built as `fhir.js` on the site) if you want it.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | [`CheckinRequestInput`](#checkinrequestinput) |

#### Returns

[`SmartCheckinRequest`](#smartcheckinrequest)

***

### resolveResponders()

```ts
function resolveResponders(policy?, options?): Promise<Responder[]>;
```

Defined in: [src/kit/responders.ts:86](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/responders.ts#L86)

Resolve a policy into the options to render.

```ts
const responders = await resolveResponders({
  platform: true,
  webWallets: "/config/wallets.json",
  default: "platform",
});
// → render one button per responder; disable the unavailable ones;
//   the one with isDefault is the primary action
```

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `policy` | [`ResponderPolicy`](#responderpolicy) |
| `options` | \{ `detectSupport?`: () => [`DcApiSupport`](#dcapisupport); `fetchImpl?`: [`FetchLike`](#fetchlike); \} |
| `options.detectSupport?` | () => [`DcApiSupport`](#dcapisupport) |
| `options.fetchImpl?` | [`FetchLike`](#fetchlike) |

#### Returns

`Promise`\<[`Responder`](#responder)[]\>

***

### resolveScenario()

```ts
function resolveScenario(key): Scenario;
```

Defined in: [src/kit/scenarios.ts:252](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/scenarios.ts#L252)

Public barrel: the check-in protocol surface.

The library's job ends when your code has a validated SmartCheckinResponse.
FHIR writing is a separate, optional module — import it from
`./fhir/index.ts` (built as `fhir.js` on the site) if you want it.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `key` | `string` |

#### Returns

[`Scenario`](#scenario)

***

### runCheckin()

```ts
function runCheckin(input, options?): Promise<CheckinOutcome>;
```

Defined in: [src/kit/index.ts:114](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/index.ts#L114)

Run the flow and report what happened, without throwing for ordinary
outcomes (declined, unsupported browser). Use this when you want to branch
on `status`; use `requestCheckin` when you just want the data.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | [`CheckinRequestInput`](#checkinrequestinput) |
| `options` | [`CheckinOptions`](#checkinoptions) |

#### Returns

`Promise`\<[`CheckinOutcome`](#checkinoutcome)\>

***

### sealWalletResponse()

```ts
function sealWalletResponse(input): Promise<{
  data: {
     response: string;
  };
  protocol: string;
}>;
```

Defined in: [src/kit/mock-wallet.ts:219](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/mock-wallet.ts#L219)

Wallet side: sign and HPKE-seal a SMART response for the verifier.
`verifierOrigin` is the requesting page's origin — the SessionTranscript
binds to it, so a response cannot be replayed to a different origin.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `encryptionInfoBytes`: `Uint8Array`; `smartResponse`: [`SmartCheckinResponse`](#smartcheckinresponse); `verifierOrigin`: `string`; \} |
| `input.encryptionInfoBytes` | `Uint8Array` |
| `input.smartResponse` | [`SmartCheckinResponse`](#smartcheckinresponse) |
| `input.verifierOrigin` | `string` |

#### Returns

`Promise`\<\{
  `data`: \{
     `response`: `string`;
  \};
  `protocol`: `string`;
\}\>

***

### sessionIdFromHash()

```ts
function sessionIdFromHash(hash): string | null;
```

Defined in: [src/kit/handoff.ts:72](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/handoff.ts#L72)

The session id from a hand-off page's location hash, or null.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `hash` | `string` |

#### Returns

`string` \| `null`

***

### validateResponseAgainstRequest()

```ts
function validateResponseAgainstRequest(request, response): ValidationResult<SmartCheckinResponse>;
```

Defined in: [src/model/validate.ts:181](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/validate.ts#L181)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `request` | `unknown` |
| `response` | `unknown` |

#### Returns

[`ValidationResult`](#validationresult)\<[`SmartCheckinResponse`](#smartcheckinresponse)\>

***

### validateSmartCheckinRequest()

```ts
function validateSmartCheckinRequest(v): ValidationResult<SmartCheckinRequest>;
```

Defined in: [src/model/validate.ts:14](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/validate.ts#L14)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `v` | `unknown` |

#### Returns

[`ValidationResult`](#validationresult)\<[`SmartCheckinRequest`](#smartcheckinrequest)\>

***

### validateSmartCheckinResponse()

```ts
function validateSmartCheckinResponse(v): ValidationResult<SmartCheckinResponse>;
```

Defined in: [src/model/validate.ts:105](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/model/validate.ts#L105)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `v` | `unknown` |

#### Returns

[`ValidationResult`](#validationresult)\<[`SmartCheckinResponse`](#smartcheckinresponse)\>

***

### validateWalletRegistry()

```ts
function validateWalletRegistry(value): ValidationResult<WalletRegistry>;
```

Defined in: [src/kit/wallet-registry.ts:54](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/kit/wallet-registry.ts#L54)

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `value` | `unknown` |

#### Returns

[`ValidationResult`](#validationresult)\<[`WalletRegistry`](#walletregistry)\>

***

### verifyDeviceResponseSignatures()

```ts
function verifyDeviceResponseSignatures(input): Promise<DocumentVerification[]>;
```

Defined in: [src/wire/verify.ts:55](https://github.com/smart-health-checkin/client/blob/2b4171ff1c23d1ead7d05462e6b768b9a48b022e/src/wire/verify.ts#L55)

Verify every document in a DeviceResponse. All three checks are reported
independently so a caller can apply deployment trust policy (e.g. accept a
self-attested wallet chain while still requiring a valid signature).

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `input` | \{ `deviceResponseBytes`: `Uint8Array`; `sessionTranscript`: `Uint8Array`; \} |
| `input.deviceResponseBytes` | `Uint8Array` |
| `input.sessionTranscript` | `Uint8Array` |

#### Returns

`Promise`\<`DocumentVerification`[]\>
