github supabase-community/supabase-kt 2.0.0

latest releases: 3.7.0, 3.7.0-beta-1, 3.6.0...
2 years ago

Note

Migration guide
Documentation

Changes

Core

  • Add tag for all logging occurences

GoTrue

  • Rename and refactor GoTrue methods and classes (in #337 by @jan-tennert):
    • Rename GoTrue plugin to Auth
    • Rename GoTrueConfig to AuthConfig
    • Rename SupabaseClient#gotrue to SupabaseClient#auth
    • Rename Auth#loginWith to Auth#signInWith
    • Rename Auth#logout to Auth#signOut
    • Rename LogoutScope to SignOutScope
  • Remove Auth#sendOtpTo and add new OTP auth provider (in #350 by @jan-tennert):
supabase.auth.signInWith(OTP) {
    email = "example@email.com"
}
supabase.auth.signInWith(SSO) {
    domain = "domain"
}
  • Rename AdminUserUpdateBuilder#phoneNumber to AdminUserUpdateBuilder#phone
  • Rename UserUpdateBuilder#phoneNumber to UserUpdateBuilder#phone
  • Rename Phone.Config#phoneNumber to Phone.Config#phone
  • Rename Auth#sendRecoveryEmail to Auth#resetPasswordForEmail and add PKCE support (in #367 by @jan-tennert)
  • Rework internal implementation of OAuth & SSO login
  • Add support for linking OAuth identities (experimental, untested as unsupported in hosted Supabase): (in #368 by @jan-tennert)
    • Add Auth#linkIdentity(OAuthProvider) - The works the same as signInWith(OAuthProvider) but links an additional OAuth provider to an authenticated user
    • Add Auth#unlinkIdentity(identityId)
    • Add Auth#currentIdentitiesOrNull

Realtime

  • Refactor and rename Realtime methods (in #349 by @jan-tennert):
    • Rename Realtime#createChannel to Realtime#channel
    • Remove RealtimeChannel#join and add new RealtimeChannel#subscribe method, which does the same but also connects to the realtime websocket automatically
    • Add Realtime.Config#connectOnSubscribe to disable this behaviour
    • Rename RealtimeChannel#leave to RealtimeChannel#unsubscribe
    • Add SupabaseClient#channel extension function delegating to Realtime#channel
    • Rename Realtime.Status to reflect the new methods:
      • UNSUBSCRIBED
      • SUBSCRIBING
      • SUBSCRIBED
      • UNSUBSCRIBING

Postgrest

  • Rename and refactor Postgrest methods (in #353 by @jan-tennert):
  • Remove upsert parameter in insert and update methods and add new upsert method
  • Remove returning, count and single parameters from postgrest methods
  • Rework postgrest methods:
val result = supabase.postgrest["messages"].select {
     single() //receive an object rather than an array
     count(Count.EXACT) //receive amount of database entries
     limit(10) //limit amount of results
     range(2, 3) //change range of results
     select() //return the data when updating/deleting/upserting (same as settings 'returning' to REPRESENTATION before)
     filter {
          eq("id", 1)
     }
}
  • Add new methods to this builder:
val result = supabase.postgrest["messages"].select {
     csv() //receive data as csv
     geojson() //receive data as geojson
     explain(/* */) //debug queries
}
  • Rename PostgrestResult#count to PostgrestResult#countOrNull
  • Reanem PostgrestResult#range to PostgrestResult#rangeOrNull
  • Add SupabaseClient#from delegating to Postgrest#from
  • Rename PostgrestResult#body to PostgrestResult#data
  • Change type of PostgrestResult#data to String
  • Allow destructuring of PostgrestResult: (especially handy when dealing with datatypes other than json)
val (data, headers) = supabase.from("countries").select {
    csv()
}

Compose Auth

  • Refactor and rename Realtime methods (in #345 by @jan-tennert):
    • Rename ComposeAuth#rememberLoginWithGoogle to ComposeAuth#rememberSignInWithGoogle
    • Rename ComposeAuth#rememberLoginWithApple to ComposeAuth#rememberSignInWithApple
    • Rename ComposeAuth#rememberSignOut to ComposeAuth#rememberSignOutWithGoogle
  • Re-implement Credential Manager Native Google Auth on Android 14+ (in #336 by @jan-tennert)

New module: Coil Integration

This new plugin can be added to a Coil ImageLoader to easily display images from public and non-public buckets from storage (Android only)
(in #323 by @jan-tennert).
Learn more

New module: Compose-ImageLoader Integration

This new plugin can be added to a ImageLoader to easily display images from public and non-public buckets from storage (All Compose targets) (in #335 by @jan-tennert).
Learn more

Don't miss a new supabase-kt release

NewReleases is sending notifications on new releases.