uploadData()
function that you defined in the Client-Side Setup part of the implementation. That uploadData()
function should call your backend application API to apply the writes to your backend database. The reason why we designed PowerSync this way is to give you full control over things like data validation and authorization of writes, while PowerSync itself requires minimal permissions.An overview of how PowerSync interacts with your backend application.
fetchCredentials()
function that you defined in the Client-Side Setup can therefore call your backend application API to generate a JWT which can be used by PowerSync Client SDK to authenticate with the PowerSync Service.
See Authentication Setup for details.