Note
Documentation will update shortly.
Migration guide
Ktor 3
Starting with 3.0.0, supabase-kt now uses Ktor 3. This brings WASM support, but projects using Ktor 2 will be incompatible.
Ktor 3.0.0-rc-1 is used in this release.
Changes
Rename gotrue-kt to auth-kt and rename the package name
- The
gotrue-ktmodule is no longer being published starting with version3.0.0. Use the newauth-ktmodule. - Rename
auth-ktpackage name fromio.github.jan.supabase.gotruetoio.github.jan.supabase.auth.
Support for WASM-JS
New wasm-js target for supabase-kt, auth-kt, storage-kt, functions-kt, postgrest-kt, realtime-kt, compose-auth, compose-auth-ui, apollo-graphql and the new coil3-integration by @jan-tennert in #311
New plugin: coil3-integration
Support for Coil3 and all Compose Multiplatform targets under a new plugin by @jan-tennert in #428. Checkout the documentation.
The "old" coil 2 integration is still available and hasn't changed.
Auth
- Remove
Auth#modifyUser() - Remove
MfaApi#loggedInUsingMfa,MfaApi#loggedInUsingMfaFlow,MfaApi#isMfaEnabled,MfaApi#isMfaEnabledFlow - Refactor SessionStatus by @jan-tennert in #725
- Move
SessionStatusto its ownstatuspackage - Rename
SessionStatus#LoadingFromStoragetoSessionStatus#Initializing - Rename and refactor
SessionStatus#NetworkErrortoSessionStatus#RefreshFailure(cause)
Note: The cause can be eitherRefreshFailureCause#NetworkErrororRefreshFailureCause#InternalServerError. In both cases the refreshing will be retried and the session not cleared from storage. During that time, the session is obviously not usable.
- Move
Apollo GraphQL
- Migrate to Apollo GraphQL 4.0.0 by @jan-tennert in #692
Storage
Rework the uploading & downloading methods by @jan-tennert in #729
- Each uploading method (upload, update, uploadAsFlow ...) now has a
optionsDSL. Currently, you can configure three things:
- Whether to upsert or not
- The content type (will still be inferred like in 2.X if null)
- Additional HTTP request configurations
Example:
supabase.storage.from("test").upload("test.txt", "Hello World!".encodeToByteArray()) {
contentType = ContentType.Text.Plain
upsert = true
}- Each downloading method (downloadPublic, downloadAuthenticated, downloadPublicAsFlow, ...) now has a
optionsDSL. Currently you can only configure the image transformation
Example:
supabase.storage.from("test").downloadAuthenticated("test.jpg") {
transform {
size(100, 100)
}
}- Uploading options such as
upsertorcontentTypefor resumable uploads are now getting cached. If an upload is resumed, the options from the initial upload will be used.
Postgrest
- Move all optional function parameters for
PostgrestQueryBuilder#select(),insert(),upsert()andPostgrest#rpc()to the request DSL by @jan-tennert in #716
Example:
supabase.from("table").upsert(myValue) {
defaultToNull = false
ignoreDuplicates = false
}- Move the non-parameter variant of
Postgrest#rpc()to thePostgrestinterface. It was an extension function before by @jan-tennert in #726 - Add a non-generic parameter variant of
Postgrest#rpc()to thePostgrestinterface. This function will be called from the existing generic variant by @jan-tennert in #726 - Add a
schemaproperty to thePostgrest#rpcDSL by @jan-tennert in #716 - Fix
insertandupsertrequests failing when providing an emptyJsonObjectby @jan-tennert in #742
Realtime
- Refactor internal event system for maintainability and readability by @jan-tennert #696
RealtimeChannel#presenceChangeFlowis now a member function ofRealtimeChannel. (It was an extension function before) by @jan-tennert in #697- Move the implementation for
RealtimeChannel#broadcastFlowandRealtimeChannel#postgresChangeFlowto a member function ofRealtimeChannel. (Doesn't change anything in the public API) by @jan-tennert in #697 - Make the setter of
PostgresChangeFilterprivate