Links

Integrating With Your Backend

The PowerSync backend connector provides the connection between your application backend and the PowerSync managed database.
It is used to:
  1. 1.
    Retrieve a token to connect to the PowerSync instance.
  2. 2.
    Apply local changes on your backend application server (and from there, to Postgres)
Accordingly, the connector must implement two methods:
  1. 1.
    fetchCredentials() — This is called every couple of minutes and is used to obtain credentials for your app backend API. See Authentication Setup for instructions on how the credentials should be generated.
  2. 2.
    uploadData() — Use this to upload client-side changes to your app backend.
    See Writing Client Changes for considerations on the app backend implementation.

Flutter

We will use the PowerSyncBackendConnector class.
See example implementations for fetchCredentials() and uploadData().

React Native & Expo

Refer to Create a Backend Connector on the React Native & Expo SDK reference page for example implementations of fetchCredentials() and uploadData()

JS Web

Refer to Create a Backend Connector on the JS Web reference page for example implementations of fetchCredentials() and uploadData()

More Examples

For additional implementation examples, see the Example / Demo Apps section.