Skip to content

Events

client.on subscribes to one event type at a time and delivers its payload. enrollment.on('change') reports an Enrollment’s state on the device still waiting to be enrolled.

Subscribing

const unsubscribe = client.on('session', ({ state }) => render(state));

ClientEvent

type ClientEvent =
| { type: 'session'; state: SessionState }
| { type: 'locked' }
| { type: 'revoked' }
| { type: 'reachable'; reachable: boolean }
| { type: 'lease'; lease?: LeaseState }
| { type: 'worklist' }
| { type: 'enrollment-request'; requestId: string }
| { type: 'device-revoked'; recipientId: RecipientId; reason: RevocationReason }
| { type: 'backfill'; waiting: BackfillWaiting[] }
| { type: 'roles'; roles: Role[] }
| { type: 'ceremony'; ceremonyId: string }
| { type: 'drafts'; count: number };
TypePayloadWhen
sessionstateThe session’s state changed: "none", "open", "inactive", "offline" or "ended".
lockednoneThe device key was locked by client.lock().
revokednoneThe device certificate (card) of this device is no longer active. The SDK discards its offline lease and locks the Client.
reachablereachableThe Seald Healthcare Cloud became reachable or unreachable.
leaseleaseThe offline lease changed: granted, renewed or gone.
worklistnoneThe worklist changed. Call worklist.get() again.
enrollment-requestrequestIdAnother device of this person asked to enroll, or was revoked. The person sees every such request, so one they did not make is noticed.
device-revokedrecipientId, reasonA device in the tenant was revoked.
backfillwaitingThis device gained access it was waiting for. More of waiting now opens.
rolesrolesThis person’s roles changed.
ceremonyceremonyIdA break-glass ceremony this device may take part in opened or changed.
draftscountThe Seald Healthcare Cloud is back and this many drafts wait to be saved.

Enrollment’s change event

The change event fires on the device that waits to be enrolled. It fires each time the Enrollment’s state changes: pending, opened, revealed, approved, enrolled, rejected or lapsed.

enrollment.on('change', (state: EnrollmentState) => {
if (state === 'revealed') showCode(enrollment.code);
});