SupabaseConnector

open class SupabaseConnector(val supabaseClient: SupabaseClient, val powerSyncEndpoint: String, storageBucket: String? = null) : PowerSyncBackendConnector(source)

Get a Supabase token to authenticate against the PowerSync instance.

Constructors

Link copied to clipboard
constructor(supabaseUrl: String, supabaseKey: String, powerSyncEndpoint: String, storageBucket: String? = null)
constructor(supabaseClient: SupabaseClient, powerSyncEndpoint: String, storageBucket: String? = null)

Types

Link copied to clipboard

Properties

Link copied to clipboard
Link copied to clipboard
val sessionStatus: StateFlow<SessionStatus>
Link copied to clipboard
val supabaseClient: SupabaseClient

Functions

Link copied to clipboard
open suspend override fun fetchCredentials(): PowerSyncCredentials

Get credentials for PowerSync.

Link copied to clipboard
Link copied to clipboard
open suspend fun handleError(tx: CrudTransaction, entry: CrudEntry, exception: Exception, errorCode: String?)

Handles an error during the upload. This method can be overridden to log errors or customize error handling.

Link copied to clipboard
Link copied to clipboard
suspend fun login(email: String, password: String)
Link copied to clipboard
suspend fun loginAnonymously()
Link copied to clipboard
open fun prefetchCredentials(): Job
Link copied to clipboard
fun session(): UserSession?
Link copied to clipboard
suspend fun signOut()
Link copied to clipboard
suspend fun signUp(email: String, password: String)
Link copied to clipboard
fun storageBucket(): BucketApi
Link copied to clipboard
suspend fun updateCredentials()
Link copied to clipboard
open suspend fun uploadCrudEntry(entry: CrudEntry)

Uses the PostgREST APIs to upload a given entry to the backend database.

Link copied to clipboard
open suspend override fun uploadData(database: PowerSyncDatabase)

Upload local changes to the app backend (in this case Supabase).