Namespaces

ovok.invites

Send and accept record-share and care invitations.

  • Stable unknown
  • Release candidate since 0.4.49-rc.4
  • Development since 0.4.49-dev.517+4645a0a

Invitations to share a record or to enter a care relationship. Each flow has create (send) and accept (redeem). Calls routes under v1/invites.

Share a record

A patient shares their record with a practitioner, or some codes with a carer.

await ovok.invites.recordShares.create({
  recipient: 'practitioner',
  email: 'dr@example.com',
  firstName: 'Ada',
  lastName: 'Lovelace',
});

await ovok.invites.recordShares.create({
  recipient: 'related-person',
  email: 'carer@example.com',
  firstName: 'Sam',
  lastName: 'Lee',
  codes,
});
  • A related-person invite also takes codes, the data the carer may see.
  • create resolves to { status: 'sent' }.

Invite a patient into care

await ovok.invites.care.create({ email, firstName, lastName });
  • A practitioner sends this. The patient redeems it with care.accept.

Accept an invite

const share = await ovok.invites.accept({ inviteId, code });
  • accept picks the flow from the signed-in profile: a practitioner accepts a record share, a patient accepts a care invite. It throws OvokConfigError for any other profile or when signed out.
  • Call a flow's accept directly when you know the kind. recordShares.accept also takes an optional password.
  • ovok.invites.practitioners and ovok.invites.patients are deprecated. Use recordShares with recipient: 'practitioner', and care. The routes sunset on 2026-12-01.

Reference

Last updated on

On this page