Namespaces

ovok.consent

Read and record legal and medical consent, and request consent signatures.

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

Consent of the signed-in user. Legal consent covers the terms and conditions; medical consent covers medical notifications.

const { legal } = await ovok.consent.legal.retrieve();

const mustAccept = legal === null || (legal.status === 'revoked' && legal.revokedReason === 'tos-updated');

if (mustAccept) {
  await ovok.consent.legal.set(true);
}
  • legal is null when the user never answered. A revoked record with reason tos-updated means the terms changed and the user must accept again.
  • set(false) withdraws consent.
  • Calls GET and POST v1/me/consent/legal.
const { medical } = await ovok.consent.medical.retrieve();
await ovok.consent.medical.set(true);
  • medical is null until the user answers; otherwise it carries acceptedAt.
  • Calls GET and POST v1/me/consent/medical.

Request a signature

const request = await ovok.consent.requestSignature(consentId);
  • Asks the server to start a signature for an existing consent. The response describes the document to sign (documentId, title, numberOfPages, email).

Reference

Last updated on

On this page