Skip to content

Quickstart

Open a record from a folder and render it. Every feature you build on the Client SDK has this shape: a call, a Decided and a render.

Create the SDK and connect

connect unlocks the device key for one tenant and returns a Client, with no session open yet.

import { create } from 'seald-sdk';
const sealdhealthcare = await create({ kind: 'desktop', release: '1.4.0', adapters: { unlock, signIn } });
const client = await sealdhealthcare.connect(tenantId); // unlocks the device key

Sign in

session.signIn() runs the identity provider in the system browser and proves the device key at once.

await client.session.signIn(); // signs in with the identity provider and proves the device key

List a folder

A listing opens the folder index. It gets one decision, like any other open.

const listing = await client.folders.list(folder); // opens the folder index: one decision
if (listing.outcome !== 'allow') return show(listing);

Open a record

Each objects.open call gets one decision and records one access event. The decision is allow, challenge or deny. Handle every case.

const opened = await client.objects.open({ locator: listing.entries[0].locator });
switch (opened.outcome) {
case 'allow':
render(opened); // shows the fields and marks masked ones
opened.close(); // discards the plaintext and its keys
break;
case 'challenge':
return show(await opened.stepUp()); // signs in again, then repeats the request
case 'deny':
return showReason(opened.reason, opened.text); // shows why, and who can give access
}

Every other feature has the same shape:

  • Copy and Print from the surface call opened.request('copy'). Each gets its own decision.
  • Saving calls objects.save(locator, content, { baseVersion }).
  • Sharing, legal holds and evidence export each return a Decided to render.

Next