Skip to content

Releases: supabase-community/supabase-kt

3.0.1

10 Oct 19:09
eafba42
Compare
Choose a tag to compare

Changes

Core

  • Add support for Kotlin 2.0.21
  • Add support for Ktor 3.0.0

Auth

  • Add HTTP Callback Server support for mingwx64 (untested)

Coil3 Integration

  • Add support for Coil3 version 3.0.0-rc01

3.0.0

01 Oct 18:50
21a7779
Compare
Choose a tag to compare

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-kt module is no longer being published starting with version 3.0.0. Use the new auth-kt module.
  • Rename auth-kt package name from io.github.jan.supabase.gotrue to io.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 SessionStatus to its own status package
    • Rename SessionStatus#LoadingFromStorage to SessionStatus#Initializing
    • Rename and refactor SessionStatus#NetworkError to SessionStatus#RefreshFailure(cause)
      Note: The cause can be either RefreshFailureCause#NetworkError or RefreshFailureCause#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.

Apollo GraphQL

Storage

Rework the uploading & downloading methods by @jan-tennert in #729

  • Each uploading method (upload, update, uploadAsFlow ...) now has a options DSL. Currently, you can configure three things:
  1. Whether to upsert or not
  2. The content type (will still be inferred like in 2.X if null)
  3. 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 options DSL. Currently you can only configure the image transformation
    Example:
supabase.storage.from("test").downloadAuthenticated("test.jpg") {
    transform {
        size(100, 100)
    }
}
  • Uploading options such as upsert or contentType for 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() and Postgrest#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 the Postgrest interface. It was an extension function before by @jan-tennert in #726
  • Add a non-generic parameter variant of Postgrest#rpc() to the Postgrest interface. This function will be called from the existing generic variant by @jan-tennert in #726
  • Add a schema property to the Postgrest#rpc DSL by @jan-tennert in #716
  • Fix insert and upsert requests failing when providing an empty JsonObject by @jan-tennert in #742

Realtime

  • Refactor internal event system for maintainability and readability by @jan-tennert #696
  • RealtimeChannel#presenceChangeFlow is now a member function of RealtimeChannel. (It was an extension function before) by @jan-tennert in #697
  • Move the implementation for RealtimeChannel#broadcastFlow and RealtimeChannel#postgresChangeFlow to a member function of RealtimeChannel. (Doesn't change anything in the public API) by @jan-tennert in #697
  • Make the setter of PostgresChangeFilter private

3.0.0-rc-2

30 Sep 16:39
28f3c33
Compare
Choose a tag to compare
3.0.0-rc-2 Pre-release
Pre-release

Changes

Storage

  • Add missing option builders for resumable uploads and cache upsert and contentType options by @jan-tennert in #739

Postgrest

  • Fix postgrest request failing when providing an empty JsonObject for insert or upsert by @jan-tennert in #742

3.0.0-rc-1

24 Sep 18:37
97eb197
Compare
Choose a tag to compare
3.0.0-rc-1 Pre-release
Pre-release

Changes

Auth

  • Refactor SessionStatus by @jan-tennert in #725
    • Move SessionStatus to its own status package
    • Rename SessionStatus#LoadingFromStorage to SessionStatus#Initializing
    • Rename and refactor SessionStatus#NetworkError to SessionStatus#RefreshFailure(cause)
      Note: The cause can be either RefreshFailureCause#NetworkError or RefreshFailureCause#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.

3.0.0-beta-1

18 Sep 17:37
5e42c27
Compare
Choose a tag to compare
3.0.0-beta-1 Pre-release
Pre-release

Note

Because of the amount of breaking changes in the 2.7.0 beta, I decided to merge this version into the planned 3.0.0 version.
2.7.0 will no longer release.
This changelog is a combination of 2.7.0-beta-1 and new breaking changes.

Ktor 3

Starting with 2.7.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-kt module is no longer being published starting with version 3.0.0. Use the new auth-kt module.
  • Rename auth-kt package name from io.github.jan.supabase.gotrue to io.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

Apollo GraphQL

Storage

Rework the uploading & downloading methods by @jan-tennert in #729

  • Each uploading method (upload, update, uploadAsFlow ...) now has a options DSL. Currently you can configure three things:
  1. Whether to upsert or not
  2. The content type (will still be inferred like in 2.X if null)
  3. 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 options DSL. Currently you can only configure the image transformation
    Example:
supabase.storage.from("test").downloadAuthenticated("test.jpg") {
    transform {
        size(100, 100)
    }
}

Postgrest

  • Move all optional function parameters for PostgrestQueryBuilder#select(), insert(), upsert() and Postgrest#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 the Postgrest interface. It was an extension function before by @jan-tennert in #726
  • Add a non-generic parameter variant of Postgrest#rpc() to the Postgrest interface. This function will be called from the existing generic variant by @jan-tennert in #726
  • Add a schema property to the Postgrest#rpc DSL by @jan-tennert in #716

Realtime

  • Refactor internal event system for maintainability and readability by @jan-tennert #696
  • RealtimeChannel#presenceChangeFlow is now a member function of RealtimeChannel. (It was an extension function before) by @jan-tennert in #697
  • Move the implementation for RealtimeChannel#broadcastFlow and RealtimeChannel#postgresChangeFlow to a member function of RealtimeChannel. (Doesn't change anything in the public API) by @jan-tennert in #697
  • Make the setter of PostgresChangeFilter private

2.6.1

05 Sep 09:38
bfdef00
Compare
Choose a tag to compare

Changes

Postgrest

  • Fix custom headers being ignored by Postgrest#rpc

2.6.0-wasm0

21 Jul 20:11
c9f8f86
Compare
Choose a tag to compare
2.6.0-wasm0 Pre-release
Pre-release

Note

The Ktor EAP repository is no longer required as a new official beta of Ktor 3.0.0 has been released. You will also need to use this exact Ktor version for your engines.

Changes

  • Migrate to Ktor 3.0.0-beta-2
  • Merge 2.4.2-2.6.0 changes into wasm

2.6.0

16 Aug 17:19
a07783f
Compare
Choose a tag to compare

Note

The documentation has also been updated. Checkout the third-party auth overview page if you want to use Firebase Auth, AWS Cognito or Auth0 instead of Supabase Auth.

Changes

Core

  • Update Kotlin to 2.0.10

Postgrest

  • Expose headers and params in PostgrestRequestBuilder by @jan-tennert in #689
    You can now set custom headers & url parameters while making a postgrest request

Auth

  • Add support for third-party auth by @jan-tennert in #688
    You can now use third-party auth providers like Firebase Auth instead of Supabase Auth by specifying a AccessTokenProvider in the SupabaseClientBuilder:
    val supabase = createSupabaseClient(supabaseUrl, supabaseKey) {
        accessToken = {
              //fetch the third party token
             "my-token"
        }
    }
    This will be used for the Authorization header and other modules like Realtime and Storage integrations!
    Note: The Auth plugin cannot be used in combination and will throw an exception if used when setting accessToken.
  • Changes to Multi-Factor-Authentication by @jan-tennert in #681
    • Refactor the syntax for enrolling MFA factors and add support for the Phone factor type:
      //Enrolling a phone factor
      val factor = client.auth.mfa.enroll(FactorType.Phone, friendlyName) {
          phone = "+123456789"
      }
      
      //Enrolling a TOTP factor
      val factor = client.auth.mfa.enroll(FactorType.TOTP, friendlyName) {
          issuer = "Issuer"
      }
    • Add a channel parameter to MfaApi#createChallenge to allow sending phone MFA messages to either SMS or WHATSAPP.
    • Deprecate MfaApi#loggedInUsingMfa and MfaApi#isMfaEnabled & their flow variants in favor of MfaApi#status and MfaApi#statusFlow:
      val (enabled, active) = client.auth.mfa.status
      
      //Flow variant
      client.auth.mfa.statusFlow.collect { (enabled, active) ->
          processChange(enabled, active)
      }
  • Add SlackOIDC OAuthProvider by @jan-tennert in #688

Realtime

  • Remove client-side rate-limiting in #678 by @jan-tennert
  • Fix broadcasting to a private channel via the HTTP API in #673 by @jan-tennert
  • Fix callbacks not getting removed correctly in the CallbackManager in #673 by @jan-tennert
  • Change internal realtime implementation to be more robust and testable in #673 by @jan-tennert
    • Add Realtime.Config#websocketFactory: This is highly internal and should be only modified if you know what you are doing

Storage

  • The StorageApi#authenticatedRequest method is now suspending
  • All uploading methods will now return a FileUploadResponse instead of a String, which includes the actual path and some other properties.

2.6.0-rc-1

15 Aug 15:37
6d914de
Compare
Choose a tag to compare
2.6.0-rc-1 Pre-release
Pre-release

Changes

Core

  • Update Kotlin to 2.0.10

Postgrest

  • Expose headers and params in PostgrestRequestBuilder by @jan-tennert in #689
    You can now set custom headers & url parameters while making a postgrest request

Auth

  • Add support for third-party auth by @jan-tennert in #688
    You can now use third-party auth providers like Firebase Auth instead of Supabase Auth by specifying a AccessTokenProvider in the SupabaseClientBuilder:
    val supabase = createSupabaseClient(supabaseUrl, supabaseKey) {
        accessToken = {
              //fetch the third party token
             "my-token"
        }
    }
    This will be used for the Authorization header and other modules like Realtime and Storage integrations!
    Note: The Auth plugin cannot be used in combination and will throw an exception if used when setting accessToken.
  • Changes to Multi-Factor-Authentication by @jan-tennert in #681
    • Refactor the syntax for enrolling MFA factors and add support for the Phone factor type:
      //Enrolling a phone factor
      val factor = client.auth.mfa.enroll(FactorType.Phone, friendlyName) {
          phone = "+123456789"
      }
      
      //Enrolling a TOTP factor
      val factor = client.auth.mfa.enroll(FactorType.TOTP, friendlyName) {
          issuer = "Issuer"
      }
    • Add a channel parameter to MfaApi#createChallenge to allow sending phone MFA messages to either SMS or WHATSAPP.
    • Deprecate MfaApi#loggedInUsingMfa and MfaApi#isMfaEnabled & their flow variants in favor of MfaApi#status and MfaApi#statusFlow:
      val (enabled, active) = client.auth.mfa.status
      
      //Flow variant
      client.auth.mfa.statusFlow.collect { (enabled, active) ->
          processChange(enabled, active)
      }
  • Add SlackOIDC OAuthProvider by @jan-tennert in #688

Storage

  • The StorageApi#authenticatedRequest method is now suspending
  • All uploading methods will now return a FileUploadResponse instead of a String, which includes the actual path and some other properties.

2.6.0-beta-1

30 Jul 23:00
1abb73e
Compare
Choose a tag to compare
2.6.0-beta-1 Pre-release
Pre-release

Changes

Realtime

  • Remove client-side rate-limiting in #678 by @jan-tennert
  • Fix broadcasting to a private channel via the HTTP API in #673 by @jan-tennert
  • Fix callbacks not getting removed correctly in the CallbackManager in #673 by @jan-tennert
  • Change internal realtime implementation to be more robust and testable in #673 by @jan-tennert
    • Add Realtime.Config#websocketFactory: This is highly internal and should be only modified if you know what you are doing.