Releases: supabase-community/supabase-kt
Releases · supabase-community/supabase-kt
2.2.0
Changes
Core
- Reworked internal logging to support new features, including:
- Setting the default logging level within the SupabaseClientBuilder:
Note: The default logging level is set to
val supabase = createSupabaseClient(url, key) { defaultLogLevel = LogLevel.WARNING }
LogLevel.INFO
- Changing the logging level per plugins:
Auth.setLogLevel(LogLevel.NONE)
- Overall better and more debug log messages
- Setting the default logging level within the SupabaseClientBuilder:
Auth
- Changes to
SessionStatus
:- The
Authenticated
now has asource
property which can beStorage
,SignIn
,SignUp
,Refresh
,External
,UserChanged
,UserIdentitiesChanged
orUnknown
- The
Authenticated
now also has aisNew
property which returns true if thesource
is eitherSignIn
,SignUp
orExternal
- The
NotAuthenticated
status is now a data class rather than an object and has aisSignOut
property
- The
- Rename
Auth#oAuthUrl
toAuth#getOAuthUrl
- Changes to OAuth using Http Callback Servers:
- Switch to Ktor for Http Callback Servers when using OAuth on Desktop targets. Signing in using an OAuth provider e.g. with
signInWith(Google)
will now block the current coroutine until the flow succeeds or times out. - Add support for using a Http Callback Server for OAuth in the Kotlin
macosX64*
andlinuxX64
targets
* Only used if no deeplink host & scheme or a default redirect url is provided. - Add
AuthConfig#httpCallbackConfig()
method for configuring these servers.
- Switch to Ktor for Http Callback Servers when using OAuth on Desktop targets. Signing in using an OAuth provider e.g. with
- Add
host
andscheme
auth config properties to common code (will still not used by all targets) - Add
AuthConfig#defaultRedirectUrl
to override the default redirect url used for requests. Defaults to null, which means that everything stays as it is; Desktop targets will use a http callback server, mobile targets deeplinks, etc.
Compose Auth
- (Android) The Credential Manager will now always be used for all Android versions
- By default, when signing out using
Auth#signOut
orAuth#clearSession
the Google credential will now also be cleared.- Because sign-outs are now handled automatically,
ComposeAuth#rememberSignOutWithGoogle
has been removed.
- Because sign-outs are now handled automatically,
- You now pass in the
nonce
andextraData
when callingstartFlow
rather than in the plugin settings.- If no
nonce
parameter is specified (or not set to null manually), the library will now take care of generating a nonce and using it for authentication.
- If no
NativeSignInState#started
has been changed toNativeSignInState#status
which can beStarted
orNotStarted
- The Apple Native Sign-In method no longer has any arguments, as they are not needed. Note: I don't think that fixes the Apple Native Sign-In problem.
- Add debug logs and log exceptions caught while trying Native Sign-In
Realtime
- Add support for realtime message throttling in #471
There is now a new realtime config property:eventsPerSecond
(default is 10), which configures a client-side rate-limit for sending broadcasts, presence updates etc. If this rate-limit is exceeded, any message within this duration will fail.
Set to a negative number to disable.
Check the Supabase docs for more information.
2.1.6
2.2.0-rc-1
Note
WASM support will be skipped again as Ktor won't be releasing a stable version supporting WASM-JS anytime soon.
Changes
Auth
- Add
SessionStatus.Authenticated#isNew
: This will be true if the session source is a sign in, sign up or is external. Use this to to determine whether you e.g. change the screen.
2.2.0-alpha-2
Changes
Auth
- Changes to
SessionStatus
:- The
Authenticated
now has asource
property which can beStorage
,SignIn
,SignUp
,Refresh
,External
,UserChanged
,UserIdentitiesChanged
orUnknown
- The
NotAuthenticated
status is now a data class rather than an object and has aisSignOut
property
- The
Compose Auth
- (Android) The Credential Manager will now always be used for all Android versions
- By default, when signing out using
Auth#signOut
orAuth#clearSession
the Google credential will now also be cleared. - You now pass in the
nonce
andextraData
when callingstartFlow
rather than in the plugin settings. - If no
nonce
parameter is specified (or not set to null manually), the library will now take care of generating a nonce and using it for authentication. NativeSignInState#started
has been changed toNativeSignInState#status
which can beStarted
orNotStarted
- The apple native sign in method no longer has any arguments, as they are not needed. Note: I don't think that fixes the Apple Native Sign in problem.
2.1.5
2.1.4
2.2.0-alpha-1
Changes
Core
- Reworked internal logging to support new features including:
- Setting the default logging level within the SupabaseClientBuilder:
Note: The default logging level is set to
val supabase = createSupabaseClient(url, key) { defaultLogLevel = LogLevel.WARNING }
LogLevel.INFO
- Changing the logging level per plugins:
Auth.setLoggingLevel(LogLevel.NONE)
- Overall better and more debug log messages
- Setting the default logging level within the SupabaseClientBuilder:
Auth
- Rename
Auth#oAuthUrl
toAuth#getOAuthUrl
- Switch to Ktor for Http Callback Servers when using OAuth on Desktop targets. Signing in using an OAuth provider e.g. with
signInWith(Google)
will now block the current coroutine until the flow succeeds or times out. - Add support for using a Http Callback Server for OAuth in the Kotlin
macosX64*
andlinuxX64
targets
* Only used if no deeplink host & scheme or a default redirect url is provided. - Add
AuthConfig#httpCallbackConfig()
method for configuring these servers. - Add
host
andscheme
auth config properties to common code (will still not used by all targets) - Add
AuthConfig#defaultRedirectUrl
to override the default redirect url used for requests. Defaults to null, which means that everything stays as it is; Desktop targets will use a http callback server, mobile targets deeplinks, etc.
Realtime
- Add support for realtime message throttling in #471
There is now a new realtime config property:eventsPerSecond
(default is 10), which configures a client-side rate-limit for sending broadcasts, presence updates etc. If this rate-limit is exceeded, any message within this duration will fail.
Set to a negative number to disable.
Check the Supabase docs for more information.
2.1.3
Changes
Auth
- [Android]: If
enableLifecycleCallbacks
is set to true and the app goes to background, thesessionStatus
value will get set toLoadingFromState
(before it wasn't changed at all). This fixes a problem that caused other plugins to use a potentially expired session after the app goes back into foreground because the session wasn't refreshed yet.
Note: You obviously have to handle theLoadingFromStorage
status, e.g. by showing a loading screen.
On the client side, it will be onLoadingFromStorage
and then back toAuthenticated
once the session is definitely valid. - Add
oldStatus
property toSessionStatus.Authenticated
. This can be used to check if a new status emitted is just a refresh (so the oldStatus will just beAuthenticated
), or an actual login (e.g. oldStatus will beNotAuthenticated
)
Full Changelog: 2.1.2...2.1.3
2.1.2
Changes
GoTrue
- Add missing OTP type
OtpType.Email.EMAIL
by @jan-tennert in #451
and deprecateSIGNUP
andMAGIC_LINK
2.1.1
Changes
Postgrest
- Fix regex error in Safari 16.x or lower by @MohamedRejeb in #445
New Contributors
- @MohamedRejeb made their first contribution in #445