Skip to content

API reference

Use this index to find the interface you call or implement. The examples use the Entry model and Edit mutation from the getting-started tutorial. Generated names change with your schema: Entry becomes your model name, and edit becomes your mutation name.

Application interfaces

Interface Use it to Reference
GeneratedClient.open Open a local database and optionally start background sync Generated client
client.models.<model> Read, query, watch and follow relations in local data Model APIs
client.transaction Commit local writes and queued mutations together Transactions
tx.models.<model> Create, update or delete local-only records Local-only writes
tx.mutate.<mutation> Apply a declared local change and queue its backend operation Mutations
client.channels Subscribe or unsubscribe to a named channel Channels
client.connection Pause, resume or wake background sync Connections
client.status, client.close Inspect pending work and release resources Status and lifecycle
Model, Identity, Patch, Filter and Order types Pass typed data to generated methods Generated data types
Handlers<Tx>, HandlerCall Implement each mutation's authoritative business logic Handlers
Loaders<Tx>, LoaderCall Return current records for synchronization Loaders
notify, NotifyArgs, model reference functions Tell Ahead which records changed on which channels Notifications
createBackend, Options<Tx> Connect your implementations to the backend runtime Backend setup
backend.listen Serve sync requests and close the listener Listener
Authenticate, devAuth Identify the caller Authentication
MutationRejected, translateRejection, onError Reject business operations and diagnose failures Errors
backend.notify, backend.bindTransaction Notify about writes performed outside a handler Background writes
Database, Persistence, prisma Run business and sync storage in the same database transaction Database adapters

Advanced interfaces

Interface Use it to Reference
Client, Transaction, QuerySpec, RecordValue Access the generic runtime beneath generated APIs Client runtime
ServerOptions, SyncServer, ConnectionOptions Configure the backend connection and refresh credentials Server connection
RuntimeConnection, AuthenticationExpired Control Dart sync and identify authentication failures Connections
recordStatus, dismissRejection, drop Inspect a record's pending work and handle rejected or unsent mutations Recovery APIs
pendingTasks, runPrerequisites, setReadiness Complete prerequisite I/O before a mutation can be sent Prerequisites
freeze, acknowledge, applyPull Exercise the engine protocol in tests and tooling Protocol primitives
ReadPort, WritePort, LivePort, model factories and codecs Bind generated facades to a compatible runtime Generated extension points
loaderHooks, Native Prepare a loader call or supply the native backend binding Backend extension points
Compiler command and .model declarations Generate and evolve the interface contract Schema compiler

The generated application API is the normal entry point. Raw backend protocol methods marked @internal in the implementation are not a supported application integration surface; use listen, handlers, loaders and transaction-bound notifications.