Skip to main content
Each example implements the two methods of a backend connector: fetchCredentials() and uploadData(). The Rust SDK splits these into an Authenticator and a MutationUploader. Copy the example for your SDK into your app, then replace the placeholders.

Custom Backend

Your app uploads writes to its own backend, or to the reference write endpoint.

Supabase

Your source database is Supabase and your app uses Supabase Auth.

Custom Backend

Use these examples if your app uploads writes to its own backend. By default, they call the reference write endpoint, POST /api/data. If your API’s request or response format differs, either change the request and response handling in uploadData() to match your API, or use the prompt for your coding agent to generate an uploadData() for it. Each example sends the same JWT to your PowerSync instance and to your write endpoint. Replace the token placeholder with a token from your auth provider. See Authentication Setup.
PowerSyncConnector.js

Supabase

Use these examples if your source database is Supabase and your app uses Supabase Auth. They upload writes with the Supabase client SDK, which is the PostgREST route. There is no Supabase example for Rust.
PowerSyncConnector.js