- Update to Kotlin
2.2.0 - Update to Ktor
3.2.0 - Don't swallow
CancellationExceptionby @sproctor in #895 - Only catch serialization exceptions in
bodyOrNullby @jan-tennert in supabase-community#904 - Fix simple warnings by @sproctor in supabase-community#915
- Use Dispatchers.IO by default on multi-threaded platforms by @sproctor in supabase-community#905
- Configurable default dispatcher
SupabaseClientBuilder#coroutineDispatcher, defaulting toDispatchers.IOon supported targets. - Deprecated
AuthConfig#coroutineDispatcher, replaced by the new client wide dispatcher.
- Configurable default dispatcher
- Add new standard headers by @jan-tennert in supabase-community#927
-
Add new event system, add support for error code in OTP links by @jan-tennert in supabase-community#912
supabase.auth.events.collect { when(it) { is AuthEvent.OtpError -> { println(it.errorCode) } is AuthEvent.RefreshFailure -> TODO() } }New event system which exists next to the
sessionStatus, but works independently. Currently there are two events:AuthEvent.OtpError(...)- will be emitted if an error code was found in a OTP link (deeplink on Android/iOS, URL on JS and Desktop)AuthEvent.RefreshFailure(cause)- will be emitted if a session refresh failed (regardless if the session is still valid)
This PR also changes the
SessionStatus.RefreshFailure(cause):- The
causeparameter/property is deprecated (use the event for the cause) - This status will only get set, if the session expired.
--> If a refresh failed, an event will always be emitted, but the session status will only get updated if the session also expired. Planning to rename the status in the future to something like
SessionStatus.NeedsRefreshAdditional changes:
- Error related parameters will now be removed from the history when used
-
(JS, WASM JS) Add an option to disable automatic url checking by @jan-tennert in supabase-community#96
install(Auth) { disableUrlChecking = true //Default: false }
-
Add support for providing a custom url launcher by @jan-tennert in supabase-community#933 You can now provide a custom
UrlLauncherfor opening URLs in the OAuth flow:install(Auth) { urlLauncher = UrlLauncher { supabase, url -> println("Opening URL: $url") } }
-
Deprecate NativeSignInResult.NetworkError as it isn't used by @jan-tennert in supabase-community#952
-
Deprecate minimalSettings in favor of minimalConfig by @jan-tennert in supabase-community#916
-
Fix null result when sign up with Email provider by @hieuwu in supabase-community#922
- Fix OAuth server listener resuming coroutine twice by @jan-tennert in #893
A Desktop app using OAuth should no longer produce an exception when exiting the app after using
signInWith(OAuthProvider) - Add missing error codes by @jan-tennert in supabase-community#909:
EmailAddressInvalid,Web3ProviderDisabled,Web3UnsupportedChain - (JS/Wasm JS) Fix exception on non-session hash parameters and only consume used parameters by @jan-tennert in supabase-community#911 Previously, all URL parameters / hash parameter were removed after successfully authenticating, this is no longer the case.
- Fix session expiration check by @jan-tennert in supabase-community#913 The session will now also be refreshed when the current date time is under a certain threshold (20% before the actual expiration), instead of only after session expiration
- Fix serialization exception occurring when
PostgrestRestException#detailsis not a String by @jan-tennert in supabase-community#956
- Remove
sealedmodifier from interfaces where they are not needed (and prevent mocking in KMP) by @jan-tennert #883
- Fix custom serializer modules not being used in the
KotlinXSerializerby @jan-tennert in #881
- Fix JS/Wasm hash/code check and removal by @Sparky983 and @jan-tennert in supabase-community#875 Hashes & PKCE codes should now be correctly checked for on WASM, and removed from the browser history after usage.
This version requires Ktor version 3.1.1 or higher.
- Migrate to new crypto dependency by @jan-tennert in https://github.com/supabase-community/supabase-kt/commit/7440814403c1a07a32740aeec0aa527a1c2a70c5
- Clean up internal
SupabaseClientcode by @jan-tennert in supabase-community#855 - Migrate to dokka v2 by @jan-tennert in supabase-community#856
- Update to Ktor version
3.1.1
- Fix Native Apple Sign In on iOS by @yannickpulver in supabase-community#866
- Make
HttpRequestExceptiona subclass ofIOExceptionby @jan-tennert in supabase-community#847
- Catch any exceptions when sending a message in realtime by @jan-tennert in supabase-community#848
- Fix OAuth linking on JS/Wasm JS by @jan-tennert in https://github.com/supabase-community/supabase-kt/commit/d7dd01ab15995a360be91b28857a055eeb1e989d
- Improve behavior for realtime channel creation and improve docs by @jan-tennert in supabase-community#831
If a channel with the same
channelIdexists,Realtime#channel()will return it instead of creating a new one. The channel will now also be saved after callingRealtime#channel()instead at subscribing. - Add pull token approach to realtime by @jan-tennert in supabase-community#807
- Prevent sending expired tokens to realtime by @jan-tennert in supabase-community#808
- Add custom exception for PostgREST API errors and include
HttpResponseinRestExceptions by @jan-tennert in supabase-community#789- All PostgREST rest exceptions are a
PostgrestRestException, which contain PostgREST fields likehint,code. - All
RestExceptions now contain the fullHttpResponseas a property.
- All PostgREST rest exceptions are a
- Add support for file metadata,
infoandexistsby @jan-tennert in supabase-community#694
- Update
supabaseModule.ktreferences by @emmanuel-ferdman in supabase-community#823
- Make the dialog type for the Native Google Sign In configurable by @jan-tennert in supabase-community#832
New
typeparameter forrememberSignInWithGoogle(), only functional on Android.
- Add support for Kotlin
2.1.0 - Fix build errors on certain targets like
wasm-js
- Use
okiofor hashing instead ofkryptoLet me know if there are any issues!
- Add support for Ktor
3.0.1by @jan-tennert in #780
- Add IDToken support for the
KakaoOAuthProviderby @jan-tennert in #776 - Add missing
AuthErrorCodes:SessionExpired,RefreshTokenNotFound,RefreshTokenAlreadyUsedby @jan-tennert in #775
- Add support for Compose
1.7.0by @jan-tennert in #759
- Remove additional
toMap()call forRealtime#subscriptionsto prevent rare exceptions by @jan-tennert in #779
- Add support for Coil3 version
3.0.2by @jan-tennert in #780
- Add support for Kotlin
2.0.21 - Add support for Ktor
3.0.0
- Add HTTP Callback Server support for
mingwx64(untested)
- Add support for Coil3 version
3.0.0-rc01
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.
- 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.
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
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.
- Remove
Auth#modifyUser() - Remove
MfaApi#loggedInUsingMfa,MfaApi#loggedInUsingMfaFlow,MfaApi#isMfaEnabled,MfaApi#isMfaEnabledFlow - Refactor SessionStatus by @jan-tennert in supabase-community#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
- Migrate to Apollo GraphQL 4.0.0 by @jan-tennert in #692
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.
- 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
- 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
- Update Kotlin to
2.0.10
- Expose
headersandparamsinPostgrestRequestBuilderby @jan-tennert in #689
You can now set custom headers & url parameters while making a postgrest request
-
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
AccessTokenProviderin theSupabaseClientBuilder:val supabase = createSupabaseClient(supabaseUrl, supabaseKey) { accessToken = { //fetch the third party token "my-token" } }
This will be used for the
Authorizationheader and other modules like Realtime and Storage integrations! Note: TheAuthplugin cannot be used in combination and will throw an exception if used when settingaccessToken. -
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
channelparameter toMfaApi#createChallengeto allow sending phone MFA messages to eitherSMSorWHATSAPP. - Deprecate
MfaApi#loggedInUsingMfaandMfaApi#isMfaEnabled& their flow variants in favor ofMfaApi#statusandMfaApi#statusFlow:val (enabled, active) = client.auth.mfa.status //Flow variant client.auth.mfa.statusFlow.collect { (enabled, active) -> processChange(enabled, active) }
- Refactor the syntax for enrolling MFA factors and add support for the Phone factor type:
-
Add
SlackOIDCOAuthProviderby @jan-tennert in #688
- 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
CallbackManagerin #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
- Add
- The
StorageApi#authenticatedRequestmethod is now suspending - All uploading methods will now return a
FileUploadResponseinstead of aString, which includes the actual path and some other properties.
- Fix deletion in
postgresListDataFlownot working correctly by @jan-tennert in supabase-community#671
- Add support for verifying a token hash by @jan-tennert in supabase-community#657
- Add link to a RESTful service sample built with supabase-kt by @hieuwu in supabase-community#664
- fix(realtime): add private to Realtime by @grdsdev in supabase-community#642
Add support for specifying if a channel is private via
RealtimeChannelBuilder#isPrivate
- Fix Google sign in prompt in composeAuth by @Aaron246 in supabase-community#648
- fix(auth): fix sign in with Apple in ComposeAuth by @grdsdev in supabase-community#654
- Ignore certain status codes when signing out a user by @jan-tennert in supabase-community#633 Failure of signing out because of invalid/expired JWTs will now be ignored and the local session cleared.
-
Add error code enum for Auth API errors by @jan-tennert in supabase-community#618 All rest errors containing a
error_codefield will now throw aAuthRestExceptionrather than genericBadRequestExceptions, etc.AuthRestExceptions contain aerrorCodefield of the typeAuthErrorCodecontaining all known error codes. Two error codes have their own exceptions (but obviously inherit fromAuthRestException):AuthWeakPasswordExceptionandAuthSessionMissingException. API errors not containing this field will throw the generic exceptions. -
Handle
weak_passwordandsession_not_foundauth error codes by @jan-tennert in supabase-community#596 There is now a new subclass ofRestException:AuthRestExceptonwhich will be a super class for exceptions based on error codes. Currently, there are two new exceptions:AuthWeakPasswordExceptionandAuthSessionMissingException -
Fix/improve session expiry calculation by @JOsacky in #610
- Add columns header to
PostgrestQueryBuilder#insertby @jan-tennert in supabase-community#611 This fixes an issue when inserting a list of objects where some objects might not have all keys. - Add
defaultToNullparameter toPostgrestQueryBuilder#insert
- Use
PostgrestspropertyConversionMethodfor getting the property name of primary keys - Add the possibility to have a multi-column PK in realtime by @iruizmar in supabase-community#614
- Fix presences updates for
RealtimeChannel#presenceDataFlowworking incorrectly by @JOsacky in supabase-community#607
- Add
isErrorparameter to Compose Auth Ui fields by @jan-tennert in supabase-community#612 - Add AuthUiExperimental annotation by @iruizmar in supabase-community#603
All composables now have a
AuthUiExperimentalannotation instead ofSupabaseExperimental
- Update README.md by @rafalgawlik in supabase-community#605
- Fix a major bug causing sessions to be refreshed later than they should be in https://github.com/supabase-community/supabase-kt/commit/af9143d6f32c9c97c38870e8bdd20863edcbc38e by @jan-tennert
The
expiresAtproperty was saved incorrectly, delaying the expiry date.
- Remove OtpType deprecation notice and clarify documentation by @jan-tennert in supabase-community#595
The
SIGNUPandMAGIC_LINKOtpTypes are no longer deprecated as they are used for resending OTPs. - Store session before emitting Authenticated state by @iruizmar in supabase-community#600
This fixes a bug where it's possible to cancel any sign-in method and the
sessionStatusgets set toAuthenticatedwithout the session actually saving to storage due to the cancellation.
- Fix "Login in with" typo by @JOsacky in supabase-community#588
- Include columns in upsert request & change default parameter value for
defaultToNulltotrueby @jan-tennert in supabase-community#590 This fixes an issue when upserting a list of objects where some objects might not have all keys.
- Update Kotlin to 2.0.0-RC2 and Compose to 1.6.10-rc01 by @jan-tennert in #581
- Rethrow
CancellationExceptions in network requests by @jan-tennert in #578 - Log the actual error if a network request fails by @jan-tennert in https://github.com/supabase-community/supabase-kt/commit/0c93053e9ddb192f7238d719617d96eb71702bfd
- Auth changes & fixes by @jan-tennert in #568
- The method
Auth#linkIdentitywill now return the OAuth URL if the config valueExternalAuthConfigDefaults.automaticallyOpenUrlis set to false. Otherwise, null. - Fix the
autoRefreshdefault value forAuth#importSessionnot being set toconfig.alwaysAutoRefresh - Add
codeVerifierparameter toMemoryCodeVerifierCacheto be able to set an initial value - Add missing
captchaTokenconfig option in theOTPauth provider
- The method
- Change the default session key for the
SettingsSessionManagerto work with multiple instances on the same device and add akeyparameter to the constructor in case you want a custom key by @MohamedRejeb in #572
- Add new experimental extension functions to retrieve initial data and listen for updates without using realtime channels by @jan-tennert #579:
//Not a suspending function, subscribing and unsubscribing is handled internally
val myProductFlow: Flow<Product> = supabase.from("products").selectSingleValueAsFlow(Product::id) {
Product::id eq 2
}.collect {
println(it)
}val productsFlow: Flow<List<Product>> = supabase.from("products").selectAsFlow(Product::id, filter = FilterOperation("id", FilterOperator.GT, 2)).collect {
println(it)
}This requires both Realtime and Postgrest to be installed within the SupabaseClient.
- Prohibit uploading empty data to a bucket by @hieuwu in #577
- Add new
regionparameter to invoke functions which allows changing the region where the Edge Function will be invoked in. Defaults toFunctions.Config#defaultRegion(which isFunctionRegion.ANY) by @jan-tennert in #580
- Make the default value for
Storage.Config.resumable#cachenullto prevent a NullPointerException in testing enviroments. (If it's set to null, the default cache implementation will be used) - Fix
BucketApi#createSignedUploadUrlreturning an invalid url - Fix
BucketApi#createSignedUrlnot correctly adding transformation parameters - Fix
BucketApi#createSignedUrlreturning an invalid url - Fix
BucketListFilter#sortBynot working correctly - Add missing
destinationBucketparameter toBucketApi#copyandBucketApi#moveby @jan-tennert in #562
- Move
enableLifecycleCallbacksto the common source set (still only used on Android) by @jan-tennert in #561 - Add
AuthConfig#minimalSettings(useful for servers or testing, disabling session storage and uses only in-memory caches) by @jan-tennert in #561
- Remove the suspend modifier for
RealtimeChannel#postgresListDataFlowby @jan-tennert in #563 - When a postgres flow is closed, the joining payload will now be correctly cleaned by @jan-tennert in #563
- Update Kotlin to
2.0.0-RC1
- Add referenced table parameter to
orandandby @jan-tennert in supabase-community#551 - Fix nested
orblocks working incorrectly - Auto remove line breaks and white spaces when unquoted on Columns.Raw by @iruizmar in supabase-community#544
- Add support for using GET when calling database functions by @jan-tennert in supabase-community#538
There is now a
methodparameter which takes in aRpcMethod. This can either bePOST,HEADorGET. The head parameter has been removed.
- Stabilize new flow presence and postgres methods by @jan-tennert in #535
- Stabilize linking identities and signing in anonymously by @jan-tennert in #535
- Rename
Auth#modifyUsertoAuth#updateUserby @jan-tennert in supabase-community#534 - Return full a full
UserInfoon sign up by @jan-tennert in supabase-community#528 ThesignUpWithmethod will now return aUserInfoobject for theEmail,PhoneandIDTokeninstead of separate Result objects. - Allow customizing the custom tab intent on Android by @jan-tennert in supabase-community#529