Skip to main content

Types and errors

The consent client's main types and every error the reference integration throws.

Part of the API reference for the Consent Ledger LiveKit reference integration.

The main types the consent client accepts and returns, and the errors the integration throws. Types are exported from the same entry point as the function that uses them.


Types

ConsentDecision

What you pass to submitDecision:

Field

Type

Rule

sessionId

string

One per meeting, never reused. Use the LiveKit room name.

participantId

string

The participant's opaque ID. Use the LiveKit identity.

purposeId

string

What the recording is for, such as meeting-recording

noticeVersion

string

The version of the notice the participant was shown

revision

number

A positive integer, greater than the participant's current revision

choice

'accept' | 'decline' | 'withdraw'

What they chose


ConsentSubmission

What the client returns: { submissionId, decision, source, confirmation }, where confirmation.status is:

Status

Meaning

Permits recording?

confirmed

Consent Ledger stored it and the record matched (recordId)

Yes, for an acceptance

pending

Sent, not confirmed yet (recordId once Consent Ledger accepted it)

No

failed

Consent Ledger rejected it, or stored something different

No

unknown

The outcome could not be determined; needs an operator

No

ConsentPermission

What checkPermission() returns: { permitted: true } or { permitted: false, blocked: [{ participantId, reason }] }, where reason is missing, declined, withdrawn, unconfirmed, or unavailable (the store could not be read).


Errors

Error

Thrown by

Means

Suggested response

ConsentValidationError

Consent client, and createConsentClient

Bad input or options, or a revision not greater than the current one

HTTP 400 or 409; ask the caller to reload

ConsentStoreError

Consent client

The store failed; the original error is its cause

HTTP 503; nothing was confirmed

PostgresStoreError

PostgreSQL stores

A query failed or a row was invalid. Has code, table, constraint, never row values.

Log the code; check grants and connectivity

DrizzleStoreError

Drizzle stores

The same, plus dialect (postgres or sqlite). code is a SQLSTATE or a SQLite result code such as SQLITE_BUSY.

Log the code; check grants, connectivity, or SQLite locking

LedgerHttpError

createHttpLedgerClient (invalid-settings) and readRecord

Bad Consent Ledger settings, or Consent Ledger could not be read. Has a code. Writes never throw: they return rejected or unknown.

Inside the adapter this becomes a receipt status, not an exception

TypeError

Other setup functions

A missing or invalid option

Fix the configuration

For help fixing common problems, see LiveKit errors and troubleshooting.

Did this answer your question?