Part of the API reference for the Consent Ledger LiveKit reference integration.
Store current decisions, receipt references and recording jobs outside application memory. Use PostgreSQL directly, or PostgreSQL or SQLite through Drizzle.
PostgreSQL: consent-ledger-livekit/postgres
Function | Returns | Use it to |
|
| Get the SQL that creates the integration's tables (schema version 2; default schema |
|
| Keep current decisions and receipt references in PostgreSQL |
|
| Keep recording jobs and start records in PostgreSQL |
const store = createPostgresConsentStore({
client: pool, customerId, ledgerId, schema: 'consent_ledger_livekit',
});
const jobs = createPostgresRecordingJobStore({
client: pool, customerId, ledgerId, schema: 'consent_ledger_livekit',
});
const consent = createConsentClient({ ledger, store });Both stores take { client, customerId, ledgerId, schema? }. client is anything with query(text, values), such as a pg.Pool. Each store reads and changes only the rows of its customer and ledger. The consent store also has:
Method | Returns | What it does |
|
| Receipt references, including replaced decisions and ended meetings, oldest first. |
|
| Every current decision. Pass the store as the recording controller's |
Drizzle (PostgreSQL and SQLite): consent-ledger-livekit/drizzle
Function | Returns | Use it to |
|
| Keep current decisions and receipt references through Drizzle. Same methods as |
|
| Keep recording jobs and start records through Drizzle |
|
| Settings for your driver's Drizzle |
| Drizzle tables | Read the integration's rows with typed Drizzle queries. Write only through the stores. |
Both stores take { db, customerId, ledgerId, schema? }. db is a Drizzle PostgreSQL database (node-postgres, PGlite, postgres.js) or a Drizzle SQLite database on a synchronous driver (better-sqlite3); schema applies to PostgreSQL only. On PostgreSQL, db may also be a Drizzle transaction, so the store's writes commit or roll back with yours.
