Extension interfaces
The interfaces better-supabase is built on, their first-party implementations and how to plug in your own.
Every integration point is a small interface. The built-in behavior is one implementation of it, and yours can replace or sit next to it. Each interface has a conformance kit.
| Interface | Built in | Plug in with |
|---|---|---|
Executor | postgrestExecutor, postgresExecutor | betterSupabase.connect(executor) |
Compiler | postgrestCompiler, sqlCompiler | your executor |
CacheAdapter | nextCache(), queryCache(client), memoryCache() | betterSupabase.cache(adapter) |
EventSink | httpSink() | forwardMutations(betterSupabase, sink, { source }) |
AuthResolver | Bearer and cookie resolution; localAuth() in /testing | createServer(betterSupabase, { auth: { resolvers } }) |
Generator | zod(), valibot(), jsonSchema(), standardSchema() | generators in the config |
Logger | consoleLogger, silentLogger | createSupabase(schema, { logger }) |
QueueProvider | sqlQueueProvider(sql), pgmqPublicBackend(client) | createQueue({ backend, queues }) |
ScheduleProvider | sqlScheduler(sql), transportScheduler(transport), vercelScheduler(Schedules) | createQueue({ scheduler, queues }) |
SupportSessionStore | sqlSupportStore(postgres) | createServer(betterSupabase, { support: supportSessions({ store, authorize }) }) |
NotificationChannel | none (bring your email or push provider) | createNotifications({ channels }) |
DeliveryTransport | resendTransport(options) | emailChannel({ transport }) |
WebhookSigner | standardWebhooks(), hmacSigner(options) | createWebhooks({ signer }) |
WebhookTransport | fetchTransport({ allowUrl }) | createWebhooks({ http }) |
WebhookSecretStore | sqlSecretStore(transport) | createWebhooks({ secrets }) |
IncomingDestination | inboxDestination(sql), jobsDestination(jobs, options) | createIncomingWebhooks({ sql, destination }) |
StreamStore | postgresStreamStore(options), redisStreamStore(options) | teeToStore(store, id, stream), resumeFromStore(store, id) |
CredentialProvider | vaultCredentials(options), vercelConnectCredentials() | createServer(betterSupabase, { credentials }) |
PaymentProvider | stripePayments(options) | the commerce blocks |
TaxProvider | fixedRates(options), stripeTax(options) | the commerce blocks |
ShippingProvider | flatRateCarrier(options) | createShipments(client, { carriers }) |
DomainProvider | vercelDomainProvider(sdk, options) | createDomainsAdmin({ transport, provider }) |
KeyProvider | vaultKeyProvider(), vercelKmsKeyProvider(kms) | createSigningKeys({ transport, keys }) |
FileStore | supabaseFileStore(storage), vercelBlobStore(blob) | createAttachments({ files }), createDrive({ files }) |
RouteOptimizer | nearestNeighbourOptimizer(), fetchRouteOptimizer(options) | optimizeRoute(technicianId, day, { optimizer }) |
BankFeed | none (bring your bank or aggregator) | syncFeed(accountId, feed, sync) |
PayrollExportFormat | csvPayrollFormat(options) | exportRun(runId, format) |
AccountingChartFormat | none (bring your scheme's file layout) | importChart(...) in the accounting block |
TaxReportFormat | none (bring your country's return) | taxReportFormatOf(format).render(report) |
AuditFileAdapter | SAF-T OECD 2.00 | better-supabase/audit-files |
PrescriptionGateway | none (bring your pharmacy or national service) | createEPrescribing({ transport, gateway }) |
ClinicalDecisionSupport | the block's rules | createClinicalDecisionSupport({ transport, engines }) |
VulnerabilityFeed | OSV, EPSS and CISA KEV over fetch | createAdvisories({ transport, feed }) |
EnrichmentProvider | none (bring your data vendor) | createEnrichment({ transport, providers }) |
MailProvider | none (bring Gmail or Microsoft Graph) | createMailSync({ transport, providers }) |
C2paReader | none (bring c2pa-node or a verifier) | getC2paManifest in the dam block |
PreviewRenderer | none (bring a rasterizer) | renderer in createDrive and the dam kinds |
WebhookEncoder | the Standard Webhooks and CloudEvents encoders | createWebhooks({ encoders }) |
ThreadSummarizer | summarizeWith(model) in /ai-sdk | summarize(target, summarizer) |
SmartLaunchStore | none (cookie, table or cache) | createSmartLaunch({ store }) in better-supabase/fhir |
DataEngine | memoryEngine(), queryEngine(queryClient), PowerSync | the engine option of the client bindings |
AuthorizationProvider | none (built by your authorization system) | authorization in the config |
AuthorizationHooks | none (built by your authorization system) | createServer(betterSupabase, { authorization }) |
Authorizer | permissionsAuthorizer(), staticAuthorizer() in /testing | createServer(betterSupabase, { authorizer }) |
DocumentFormat | OpenAPI 3.0, 3.1, 3.2 and 3.3-preview | defineApi(...).render(format, options) |
Embedder | embedWith(model), supabaseEmbed() | createKnowledge({ embedder }), createMemory({ embedder }) |
AiTaskRunner | none (runs your agent) | createAiSchedules({ run }) |
GraphCompiler | none (your engine's compiled form) | createWorkflowEditor({ compile }) |
BuilderStarter | none (starts a run on your engine) | createWorkflowEditor({ start }) |
EveDocumentBackend | supabaseDocumentBackend(options) | eve's fileMemory({ backend }) |
BlockTransportMiddleware | none (tracing, timeouts, request ids) | wrapTransport(transport, middleware) |
EnvSource | process.env, Deno.env.toObject() | parseEnv(source) |
Plugin | timestamps, soft delete, tenant, actor, validation | betterSupabase.use(plugin) |
Executor
Runs IR operations and returns a Result. It never throws for database
errors, returns aborted when the signal is aborted, and keys rows by the
selection's aliases (the configured casing).
import type { Executor } from "better-supabase";
export function kyselyExecutor(db: Kysely<Database>): Executor {
return {
name: "kysely",
async execute(op, { signal, errorMappers }) {
// compile op, run it, map errors with mapDbError(raw, errorMappers)
},
};
}
const db = betterSupabase.connect(kyselyExecutor(kysely), { claims });batch(ops, context) is optional. db.$many hands it every operation that
is ready at once and expects one Result per operation, in order.
postgresExecutor runs them in one transaction. If one fails, it runs each
operation on its own so the others still succeed. Without batch, $many
runs the operations in parallel through execute. testExecutor checks
batch when an executor has it.
rpc(name, args, context) is optional too. context.get is set for
stable functions such as read sets. Send
those as GET, so read replicas can serve them. context.function carries
the function's generated metadata (its arguments, return type and whether it
returns a set) when the schema has it; postgresExecutor reads it to shape
the result like PostgREST.
functionSources: true says the executor honors SelectOp.source: read from
that set-returning function, with its named arguments, instead of the table.
db.$search needs it. testExecutor checks that a
missing source function fails rather than falling back to the table.
betterSupabase.connect(client, { executor }) runs the queries through executor while
db.$client stays the given client. The server uses this to wrap two
PostgREST executors for read replicas.
Compiler
Compiler<TTarget> turns an operation into what a backend runs:
postgrestCompiler.compile(op) returns the PostgREST plan and
sqlCompiler.compile(op) (from better-supabase/postgres) returns
parameterized SQL. Build a new executor on top of either, or write your own
compiler for another query builder.
CacheAdapter
Invalidates cached reads after mutations. betterSupabase.cache(adapter) calls it with the
table key, the primary keys of the changed rows and the tenant, and returns a
function that detaches it.
import type { CacheAdapter } from "better-supabase";
const redis: CacheAdapter = {
name: "redis",
invalidate: ({ table, ids, tenant }) =>
redisClient.del([
`${tenant}:${table}`,
...ids.map((id) => `${tenant}:${table}:${id}`),
]),
};
betterSupabase.cache(redis);createNext attaches nextCache() for you, and invalidateOnMutation(betterSupabase, client) attaches queryCache(client). Adapter errors are logged, never
returned from the mutation.
vercelCdnCache and vercelRuntimeCacheAdapter (better-supabase/server) purge Vercel
tags, and cacheRoute calls any adapter when a write comes from outside the process.
See Cache invalidation outside the process.
KeptStore
Where bsb.kept()
keeps entries across requests and deploys. Pass it as
createNext({ kept: { store } }). A store has get(key),
set(key, value, { ttl, tags }) and expireTags(tags), which receives bsb:
tags before any encoding. delete(key) is optional; without it an entry expires.
lease(key, holder, ttlMs) and release(key, holder) are optional too: with them
one instance fills a missing entry while the others wait up to wait milliseconds
for it, and without them every instance fills.
import type { KeptStore } from "better-supabase/server";
const store: KeptStore = {
get: (key) => redisGetJson(key),
set: (key, value, { ttl, tags }) => redisSetWithTags(key, value, ttl, tags),
expireTags: (tags) => redisExpireTags(tags),
};get may return anything; a value that is not the envelope set received is a
miss. memoryKeptStore() (better-supabase/server), vercelRuntimeCacheAdapter(getCache)
and postgresKeptStore() (better-supabase/cache-postgres) are the shipped
stores. Every store gets the Runtime Cache limits (2 MB per entry, 128 tags, 256
bytes per tag); an entry over them is not stored and is reported to kept.onSkip.
EventSink
Receives CloudEvents batches. See CloudEvents for
toCloudEvents and forwardMutations.
QueueProvider
Stores and leases jobs for createQueue. It has
apiVersion: 1, sends and reads messages, completes, fails and extends them
by attempt (a stale attempt must get false or null), and optionally
claims due schedules for the drain route, replays dead letters
(replay), and reports queue health (stats, listDead, retryDead). A message read past its max_attempts should be archived as
dead instead of returned. Set leases: false when extend
can't work, so workers skip the heartbeat.
ScheduleProvider
Decides when a schedule fires for createQueue,
apart from the queue that holds its runs. It has apiVersion: 1, a name,
schedule(name, cron, queue, payload, timeZone, nextRun, tenant?, probe?),
which writes or rewrites a schedule by name, and unschedule(name, tenant?),
which returns false when no schedule has the name. listSchedules,
unscheduleTenant, dueSchedules and advanceSchedule are optional, as on
QueueProvider; a scheduler with dueSchedules has runSchedules send its due
runs through the queue. Set delivers: "sql" when the scheduler enqueues inside
the database, or "vercel-queues" when it publishes to the job's Vercel Queues
topic, so createQueue refuses a pair that can't deliver. Every
QueueProvider is also a ScheduleProvider. Check one with
testScheduleProvider.
SupportSessionStore
Records support sessions. It has apiVersion: 1
and four methods: start(input) ends the admin's previous session and returns
the new one, get(sessionId, adminId) returns a running session only to its
admin, end(sessionId, endedBy) returns true once and false after, and
list(filter) returns sessions newest first. claims(targetUserId) is
optional and returns the claims the target would get. expire() is optional
too: it ends every running session past its expiry with endedBy: "expired"
and returns them, for support.expire(). withTemporal(namespace) is
optional as well: createServer calls it with the definition's temporal,
and it returns the store using that namespace for its time values unless the
store was given one itself. start should refuse
an admin without permission with an error whose code is 42501.
Session ids must be UUIDs. The support cookie and every lookup ignore any other
value, so support.start fails with an unexpected error whose code is
SUPPORT_SESSION_ID when the store returns another id, and
testSupportSessionStore checks it.
NotificationChannel
Sends one notification delivery on a channel
other than in-app. It has apiVersion: 1, a name that matches the
delivery's channel and send(message), which gets the recipient's id and
email, the notification and its rendered text. Return { provider, providerMessageId } to store the provider's id, { status: 'skipped' } when
there is nothing to send, and throw to retry later.
WebhookSigner
Adds the signature headers to an outgoing webhook.
It has apiVersion: 1, a name and sign({ id, body, timestamp, secrets }),
which returns the headers. secrets lists every live secret, newest first;
sign with each so receivers keep verifying while a secret rotates. The same
input must give the same headers.
WebhookTransport
Sends one signed webhook request. It has apiVersion: 1, a name and
send({ url, headers, body, signal }), which returns { status, body } for
any HTTP response. Throw WebhookPolicyError for a request that must never
be retried, such as a blocked URL; any other error retries.
WebhookSecretStore
Where destination signing secrets live. It has apiVersion: 1,
secrets(endpointId), which returns the live secrets newest first, and an
optional rotate(endpointId, { overlap, secret }) that returns the new
secret and keeps the previous ones live for overlap.
IncomingDestination
Where incoming webhooks
put a verified delivery. It has apiVersion: 1, a name and
deliver(delivery), which gets the endpoint's id, tenant and metadata, the
source, the message id, the type, the payload and the kept headers. It
returns { id, duplicate }: a repeated endpoint id and message id must
return duplicate: true, and receive answers it with 200. Throw to
answer 500 so the sender retries.
StreamStore
Durable, resumable output. It has apiVersion: 1, open, append(id, fromIdx, chunks) that skips indexes already stored and reports a cancel,
read(id, fromIdx) that waits for new chunks until the stream closes,
status, close, cancel and purge. See
Durable streams.
CredentialProvider
Turns a credential_ref into a token. It has apiVersion: 1, a name,
capabilities(ref), getToken(ref, { subject, scopes }) and
revoke(ref, { subject }), and optionally startAuthorization,
completeAuthorization and verifyInbound. See
Credentials.
PaymentProvider
Takes payments for orders in commerce. It
has apiVersion: 1, a name, createPayment, capture, refund and
parseWebhook, and optionally cancel and get. Amounts are Money in
bigint minor units. Every method returns a Result: invalid_input for an
amount the provider can't charge or a refund above what was captured,
not_found for an unknown payment, unauthorized for a bad webhook
signature and raised with the hint PAYMENT_DECLINED for a decline. A
repeated idempotencyKey returns the first call's result.
testPaymentProvider from better-supabase/testing is its conformance kit.
TaxProvider
Computes and records sales tax in commerce. It
has apiVersion: 1, a name, quote(cart), commit({ quote, reference })
and reverse({ transaction, reference, lines }). A quote has one line per
cart line in cart order, then shipping, and a total that is their sum. A
reversal has negative amounts and can't exceed the sale. testTaxProvider
is its conformance kit.
FieldPack
A set of field definitions for registered subject types, installed per
organization by the custom-fields block.
It has apiVersion: 1, a lower case key, a whole version and subjects,
a map from subject type to fields of { key, label, type, required?, sensitive?, permission? }. defineFieldPack checks one and
install_field_pack matches definitions by pack and key, so installing a
version twice changes nothing. testFieldPack is its conformance kit.
ShippingProvider
Buys labels and reads tracking for the shipments block.
It has apiVersion: 1, a name, rates(request), createLabel(request, { idempotencyKey }), track(trackingNumber) and cancel(trackingNumber),
and an optional parseWebhook(input) that verifies a signed delivery and
returns its tracking updates. Tracking events come oldest first, and each has
an id that the block records once. testShippingProvider is its conformance
kit.
EInvoiceFormat and EInvoiceChannel
A format renders an issued invoice as an e-invoice document and a channel
carries it over a network such as Peppol. Both have apiVersion: 1 and a
key. EInvoiceFormat has render(invoice, context), and
peppolBis3Format is the one better-supabase ships. EInvoiceChannel has
send(document, { recipient, invoice }), which returns a messageId, and
three optional methods: lookup(endpoint) asks whether a participant is on
the network, status(messageId) returns pending, delivered or rejected
with a reason, and receive() returns the documents waiting for the
organization. The invoices block calls them through sendEInvoice,
syncEInvoices and receiveEInvoices. testEInvoiceChannel is the channel's
conformance kit.
AuthorizationProvider
Hands the SQL modules, the Storage and Realtime policies and doctor to
another authorization system. It has apiVersion: 1 and is plain data in
better-supabase.config.ts: its scopes, the scope tenants are, and SQL
templates such as idsWith and isPlatform that answer permission checks.
Authorization providers describes
every field. testAuthorizationProvider from better-supabase/testing is its
conformance block.
The optional fields each turn on one integration:
| Field | What reads it |
|---|---|
functions.permissionsFor | member_permissions and permission_claims in the permissions module |
functions.isApprover | decide_ai_tool_approval in ai-chat and approve_support_request in impersonation |
functions.permitted | realtime topics that declare a permission on the instance in their name |
operations | workflow-editor nodes, MCP tools, AI tools and inbox commands |
functions.*For, memberIds | the modules doctor (BS411) lists when they are missing |
versions | the sessions module's authzVersions and the bootstrap wrappers (doctor BS420) |
sql: "provider" | bucket and topic access policies, rendered from functions at gen and upgrade |
AuthorizationHooks
The runtime half of an authorization provider, with apiVersion: 1: hooks
for automations, support sessions, delivery, identity links, chat actions,
approvals and run tickets, passed as authorization to createServer. Each
hook is optional and fails closed.
Runtime hooks lists
them. testAuthorizationHooks from better-supabase/testing is its
conformance block.
DeliveryTransport
Sends one notification over a channel, with apiVersion: 1, the channel
(email) and a provider name stored on the delivery. send gets the
delivery id as its idempotencyKey. resendTransport is the
shipped email transport; Notifications has the
Postmark, SES and SMTP recipes. testDeliveryTransport from
better-supabase/testing is its conformance block.
Authorizer
The runtime decision point for the permission of resources, actions,
route guards and MCP tools. It has apiVersion: 1, a name, key(ref)
and evaluate(request), plus optional forOperation and the batch
evaluations. Requests follow the AuthZEN subject, action, resource and
context model, and anything but a granted outcome refuses.
defineAuthorizer from better-supabase/server builds one and sets
apiVersion. Authorizers describes the contract, and
testAuthorizer from better-supabase/testing is its conformance block.
permissionsAuthorizer({ permissions, load }) from
better-supabase/blocks/permissions is the built-in one. It grants a key
the permissions claim lists for the request's tenant, maps table
operations to the generated permissions map, and calls load once per
request when the token is missing the claim or marks it truncated.
DocumentFormat
Renders the version-neutral API model that defineApi
builds into one document version. The OpenAPI versions are built in;
Document formats shows how to write
another, and testDocumentFormat from better-supabase/testing is its
conformance block.
Embedder
Turns texts into vectors for the knowledge and memory blocks. It has a
model name and embed(values, { signal }), which returns one vector per
value, all of one length. Version 1 (the default) returns the vectors. A
version 2 embedder (apiVersion: 2) returns { embeddings, usage?: { tokens } };
both are accepted, and embedVectors(embedder, values) normalizes a call.
testEmbedder from better-supabase/testing is its
conformance block.
TextExtractor
Reads the text of a drive file for search and knowledge (see
Text extraction). It has a name,
stored with the text, and extract(file, meta, signal), which returns the
text, or undefined for a file it doesn't read. plainTextExtractor() reads
text formats, and testTextExtractor from better-supabase/testing is its
conformance block.
AiTaskRunner
The function createAiSchedules calls for each due run, with the task, the
claimed run and an AbortSignal. It resolves with nothing or with the
chatId the run wrote to, and throws when the signal aborts.
testAiTaskRunner is its conformance block.
GraphCompiler
Turns a builder graph into your engine's form when a version is published.
It returns a JSON value, the same one for the same graph, and leaves the
graph unchanged. testGraphCompiler is its conformance block.
BuilderStarter
Starts a published version on your engine and returns the engine's run id.
A repeated idempotencyKey returns the same run. testBuilderStarter is its
conformance block.
EveDocumentBackend
eve's document store for fileMemory(). read returns the content and
version or null, and write throws when expectedVersion is stale.
testEveDocumentBackend is its conformance block.
BlockTransportMiddleware
Runs around every call a block transport makes, for every block built on it.
It has apiVersion: 1, a name, and call(request, next), where request
holds the schema, fn and args of the call. Pass a changed request to
next to rewrite it, and reject with the error next rejected with, so the
block still maps it to a DbError. testBlockTransportMiddleware from
better-supabase/testing is its conformance kit, and
Extending blocks shows it in use.
import {
defineTransportMiddleware,
wrapTransport,
} from "better-supabase/blocks";
const timed = defineTransportMiddleware({
name: "timing",
async call(request, next) {
const started = performance.now();
try {
return await next(request);
} finally {
metrics.record(request.fn, performance.now() - started);
}
},
});
const transport = wrapTransport(rpcTransport(supabase), timed);RouteOptimizer
Orders the stops of a route for the dispatch block.
It has apiVersion: 1, a name and optimize({ start, end, stops }), which
resolves with the stop ids in driving order and optional distanceMeters and
durationSeconds. The order lists every stop once. optimizeStops never
throws: an optimizer that fails or returns another order gives the
nearest-neighbour order with source: "fallback". testRouteOptimizer from
better-supabase/testing is its conformance kit.
BankFeed
Reads accounts and booked transactions for the
banking block. It has apiVersion: 1, a name,
listAccounts() and transactions(accountRef, since), both returning a
Result. Each transaction keeps its externalId between calls, which is how
syncFeed skips one it has. Write an adapter
has a template.
PayrollExportFormat
Renders an approved payroll run as the import file of one payroll system. It
has apiVersion: 1, a name and a pure render(run). The
payroll export block hashes the file and locks
the run behind that hash.
AccountingChartFormat
Reads a chart of accounts from a reference scheme's file for the
accounting block. It has apiVersion: 1, a key
and a pure parse(body), which returns accounts or a promise of them.
TaxReportFormat
Renders a tax report in one filing format. It has apiVersion: 1, a name and
render(report), which returns a Result with the file. The report boxes come
from the tax block; the format maps them to its country's
return. Write an adapter
shows how to start one.
AuditFileAdapter
Reads and writes one audit file format, such as SAF-T (see
Audit files). It has apiVersion: 1, a key, a
format, the version of the format it follows, parse(source), which
yields records one at a time so memory stays flat, and export(books), which
yields chunks of XML. defineAuditFileAdapter checks the version. Parsed
records reach the ledger through an AuditImportPort, which the imports
block's client satisfies with upsertBatch.
PrescriptionGateway
Delivers a signed prescription and its FHIR R4 MedicationRequest to a
pharmacy or a national service for the
e-prescribing block. It has a key,
deliver(delivery, request), which returns a receipt with an optional
reference of at most 200 characters or throws, and an optional cancel.
testPrescriptionGateway is its conformance kit.
ClinicalDecisionSupport
An engine that raises interaction, allergy and contraindication alerts for the
clinical decision support block. It
has a key (built-in is reserved) and evaluate(context, request), which
returns the alerts it raises now. Alerts it raised before and no longer returns
are resolved, so a fingerprint must stay stable.
testClinicalDecisionSupport is its conformance kit.
VulnerabilityFeed
Looks vulnerabilities up for the advisories block.
It has apiVersion: 1, a name, osv(id), epss(cveIds) and kev(), each
returning a Result. testVulnerabilityFeed is its conformance kit.
EnrichmentProvider
Looks up companies and people for the
enrichment block. It has apiVersion: 1, a name,
company(input) and person(input), which return a profile or undefined
when nothing matches.
MailProvider
Reads and sends a member's mail with a token from their OAuth grant, for the
mail-sync block. It has apiVersion: 1, a name,
optional scopes, list(input) and send(input), both returning a Result.
C2paReader
Reads the C2PA manifest of a file for the dam block. It has
apiVersion: 1, a name and read({ bytes, mimeType }), which resolves with
the manifest or undefined for a file without one.
PreviewRenderer
Renders the pages of a drive file as images, for the
drive block. It has apiVersion: 1, a name and
render(file, input), which returns the pages, or undefined for a file type
it doesn't handle.
WebhookEncoder
Turns claimed deliveries, as CloudEvents, into the request one endpoint format
expects, for the webhooks block. It has
apiVersion: 1, a name, signed, encode(events, target) and an optional
authorize(token).
ThreadSummarizer
Writes a summary from a thread's messages for the
messaging block. It has apiVersion: 1 and
summarize(input). The block calls no model itself.
SmartLaunchStore
Keeps the PKCE verifier and the platform's endpoints between a SMART App
Launch redirect and its callback. It has apiVersion: 1, save(state, pending) and take(state), which deletes what it returns so a callback works
once.
DataEngine
Where the client data hooks keep their reads. It has apiVersion: 1,
watch(key, load, listener), entry(key) and refetch(key), plus optional
connect(server) and sync for engines over a local database such as
PowerSync. Every engine passes the same contract suite.
Versions of the block injectables
These five carry an optional apiVersion. Omitting it means 1; the blocks
refuse any other value when they are built. The built-in embedders and
supabaseDocumentBackend set it, and the conformance blocks require it, so a
release built for API 1 says so. A function sets it with
Object.assign(fn, { apiVersion: 1 }).
AuthResolver
Resolves credentials the built-in Bearer and cookie resolution doesn't know:
API keys, third-party tokens, signed links. Return undefined when the request
has none of your credentials, and { kind: 'invalid', error } when it has bad
ones, so the request fails with 401 instead of running as anonymous.
Generator
Adds files at codegen time. Return paths relative to the project root; output
must be deterministic so gen --check works. A generator targets apiVersion: 2:
plain-data input, a version, and provides for what gen consumes. See
Generators for the kit.
Logger
Where better-supabase reports errors it swallows on purpose: event handlers,
afterMutation hooks, sinks and cache adapters that throw. Pass a structured
logger (pino, consola) or silentLogger in tests.
export const betterSupabase = createSupabase(schema, { logger: pino() });DomainProvider
Puts an organization's hostname on your hosting platform for the
domains block. It has
apiVersion: 1, a name, and add, verify, remove and status, each
taking the hostname. A status carries verified and the platform's own
verification records, which the app shows next to the block's TXT record.
createDomainsAdmin({ provider }) calls verify only after the TXT check
passes, and fails with DOMAIN_PROVIDER_UNVERIFIED until the platform agrees.
vercelDomainProvider(sdk, { projectId, teamId }) implements it over
@vercel/sdk. testDomainProvider is its conformance kit.
KeyProvider
Signs for the signing-keys block. It has
apiVersion: 1, a name, sign({ owner, data }) for a raw signature and
signJwt({ owner, claims, header }) for a compact JWS whose alg and kid
the provider sets, plus an optional noteExp when its published key set must
keep a key until a token expires. vaultKeyProvider is the default and keeps
the private keys in Supabase Vault (ADR 0033); vercelKmsKeyProvider(kms, { issuer }) signs in Vercel KMS, so the private key never reaches the app.
testKeyProvider is its conformance kit.
FileStore
Holds the bytes of the attachments
and drive blocks. It has apiVersion: 1, a name,
put, get, delete and signedUrl, each taking a bucket and a path, and
the optional head and signedUploadUrl the blocks use to confirm an upload
and to let a browser upload directly. Postgres still decides who may upload
and read: the blocks reserve the path through the SQL module first, and a
store other than Supabase Storage confirms an upload through the service role
with the size and type head reads. supabaseFileStore(storage) is the
default and vercelBlobStore(blob) keeps the bytes in Vercel Blob.
testFileStore is its conformance kit.
Last updated on