Skip to content

Commit e690bb4

Browse files
committed
Merge branch 'master' into datetime-0-7-0
2 parents eeb7e42 + da6821b commit e690bb4

File tree

68 files changed

+141
-4593
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+141
-4593
lines changed

CHANGELOG.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,78 @@
11
# Changelog
22

3+
### 3.2.0 - June 25, 2025
4+
5+
### All modules
6+
7+
- Update to Kotlin `2.2.0`
8+
- Update to Ktor `3.2.0`
9+
- Don't swallow `CancellationException` by @sproctor in #895
10+
- Only catch serialization exceptions in `bodyOrNull` by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/904
11+
- Fix simple warnings by @sproctor in https://github.com/supabase-community/supabase-kt/pull/915
12+
- Use Dispatchers.IO by default on multi-threaded platforms by @sproctor in https://github.com/supabase-community/supabase-kt/pull/905
13+
- Configurable default dispatcher `SupabaseClientBuilder#coroutineDispatcher`, defaulting to `Dispatchers.IO` on supported targets.
14+
- Deprecated `AuthConfig#coroutineDispatcher`, replaced by the new client wide dispatcher.
15+
16+
### Core
17+
18+
* Add new standard headers by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/927
19+
20+
### Auth
21+
22+
* Add new event system, add support for error code in OTP links by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/912
23+
```kotlin
24+
supabase.auth.events.collect {
25+
when(it) {
26+
is AuthEvent.OtpError -> {
27+
println(it.errorCode)
28+
}
29+
is AuthEvent.RefreshFailure -> TODO()
30+
}
31+
}
32+
```
33+
New event system which exists next to the `sessionStatus`, but works independently. Currently there are two events:
34+
- `AuthEvent.OtpError(...)` - will be emitted if an error code was found in a OTP link (deeplink on Android/iOS, URL on JS and Desktop)
35+
- `AuthEvent.RefreshFailure(cause)` - will be emitted if a session refresh failed (regardless if the session is still valid)
36+
37+
This PR also changes the `SessionStatus.RefreshFailure(cause)`:
38+
- The `cause` parameter/property is deprecated (use the event for the cause)
39+
- This status will only get set, if the session expired.
40+
41+
--> 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.NeedsRefresh`
42+
43+
Additional changes:
44+
- Error related parameters will now be removed from the history when used
45+
* (JS, WASM JS) Add an option to disable automatic url checking by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/96
46+
```kotlin
47+
install(Auth) {
48+
disableUrlChecking = true //Default: false
49+
}
50+
```
51+
* Add support for providing a custom url launcher by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/933
52+
You can now provide a custom `UrlLauncher` for opening URLs in the OAuth flow:
53+
```kotlin
54+
install(Auth) {
55+
urlLauncher = UrlLauncher { supabase, url ->
56+
println("Opening URL: $url")
57+
}
58+
}
59+
```
60+
* Deprecate NativeSignInResult.NetworkError as it isn't used by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/952
61+
* Deprecate minimalSettings in favor of minimalConfig by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/916
62+
* Fix null result when sign up with Email provider by @hieuwu in https://github.com/supabase-community/supabase-kt/pull/922
63+
- Fix OAuth server listener resuming coroutine twice by @jan-tennert in #893
64+
A Desktop app using OAuth should no longer produce an exception when exiting the app after using `signInWith(OAuthProvider)`
65+
- Add missing error codes by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/909:
66+
`EmailAddressInvalid`, `Web3ProviderDisabled`, `Web3UnsupportedChain`
67+
- (JS/Wasm JS) Fix exception on non-session hash parameters and only consume used parameters by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/911
68+
Previously, all URL parameters / hash parameter were removed after successfully authenticating, this is no longer the case.
69+
- Fix session expiration check by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/913
70+
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
71+
72+
### Postgrest
73+
74+
* Fix serialization exception occurring when `PostgrestRestException#details` is not a String by @jan-tennert in https://github.com/supabase-community/supabase-kt/pull/956
75+
376
### 3.1.4 - April 1, 2025
477

578
### All modules

Functions/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ kotlin {
1313
defaultConfig()
1414
allTargets()
1515
sourceSets {
16-
val commonMain by getting {
16+
commonMain {
1717
dependencies {
1818
addModules(SupabaseModule.AUTH, SupabaseModule.SUPABASE)
1919
}
2020
}
21-
val commonTest by getting {
21+
commonTest {
2222
dependencies {
2323
implementation(project(":test-common"))
2424
implementation(libs.bundles.testing)

Postgrest/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ kotlin {
1414
defaultConfig()
1515
allTargets()
1616
sourceSets {
17-
val commonMain by getting {
17+
commonMain {
1818
dependencies {
1919
addModules(SupabaseModule.AUTH)
2020
api(libs.kotlin.reflect)
2121
}
2222
}
23-
val commonTest by getting {
23+
commonTest {
2424
dependencies {
2525
implementation(libs.bundles.testing)
2626
implementation(project(":test-common"))

README.md

Lines changed: 33 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ For information about supported Kotlin targets, see the corresponding module REA
1010

1111
[![](https://img.shields.io/github/release/supabase-community/supabase-kt?label=stable)](https://github.com/supabase-community/supabase-kt/releases)
1212
[![](https://badgen.net/github/release/supabase-community/supabase-kt?label=prerelease)](https://central.sonatype.com/search?q=io.github.jan.supabase&smo=true)
13-
[![Kotlin](https://img.shields.io/badge/kotlin-2.1.10-blue.svg?logo=kotlin)](http://kotlinlang.org)
14-
[![Ktor](https://img.shields.io/badge/ktor-3.1.1-blue)](https://ktor.io/)
13+
[![Kotlin](https://img.shields.io/badge/kotlin-2.2.0-blue.svg?logo=kotlin)](http://kotlinlang.org)
14+
[![Ktor](https://img.shields.io/badge/ktor-3.2.0-blue)](https://ktor.io/)
1515
[![slack](https://img.shields.io/badge/slack-%23supabase--kt-purple.svg?logo=slack)](https://kotlinlang.slack.com/archives/C06QXPC7064)
1616

1717
[![ko-fi](https://www.ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/jantennert)
@@ -74,27 +74,29 @@ implementation("io.ktor:ktor-client-[engine]:VERSION")
7474
For targets: `jvm`, `android`, `js`, `ios`
7575

7676
```kotlin
77-
val commonMain by getting {
78-
dependencies {
79-
//supabase modules
77+
sourceSets {
78+
commonMain {
79+
dependencies {
80+
//Supabase modules
81+
}
8082
}
81-
}
82-
val jvmMain by getting {
83-
dependencies {
84-
implementation("io.ktor:ktor-client-cio:KTOR_VERSION")
83+
jvmMain {
84+
dependencies {
85+
implementation("io.ktor:ktor-client-cio:KTOR_VERSION")
86+
}
8587
}
86-
}
87-
val androidMain by getting {
88-
dependsOn(jvmMain)
89-
}
90-
val jsMain by getting {
91-
dependencies {
92-
implementation("io.ktor:ktor-client-js:KTOR_VERSION")
88+
androidMain {
89+
dependsOn(jvmMain.get())
9390
}
94-
}
95-
val iosMain by getting {
96-
dependencies {
97-
implementation("io.ktor:ktor-client-darwin:KTOR_VERSION")
91+
jsMain {
92+
dependencies {
93+
implementation("io.ktor:ktor-client-js:KTOR_VERSION")
94+
}
95+
}
96+
iosMain {
97+
dependencies {
98+
implementation("io.ktor:ktor-client-darwin:KTOR_VERSION")
99+
}
98100
}
99101
}
100102
```
@@ -103,7 +105,7 @@ val iosMain by getting {
103105
**Note:** It is recommended to use the same Ktor version as supabase-kt:
104106

105107
__For 3.0.0 and above:__
106-
[![Ktor](https://img.shields.io/badge/ktor-3.1.1-blue)](https://ktor.io/)
108+
[![Ktor](https://img.shields.io/badge/ktor-3.2.0-blue)](https://ktor.io/)
107109

108110
__For versions below 3.0.0:__
109111
[![Ktor](https://img.shields.io/badge/ktor-2.3.12-blue)](https://ktor.io/)
@@ -118,12 +120,16 @@ __For versions below 3.0.0:__
118120

119121
### Plugins
120122

121-
- [Apollo GraphQL integration](/plugins/ApolloGraphQL) - Creates an [Apollo GraphQL Client](https://github.com/apollographql/apollo-kotlin) for interacting with the Supabase API.
122-
- [Compose Auth](/plugins/ComposeAuth) - Provides easy Native Google & Apple Auth for Compose Multiplatform targets.
123-
- [Compose Auth UI](/plugins/ComposeAuthUI) - Provides UI Components for Compose Multiplatform.
124-
- [Coil Integration](/plugins/CoilIntegration) - Provides a [Coil2](https://github.com/coil-kt/coil) Integration for displaying images stored in Supabase Storage. Only supports Android.
125-
- [Coil3 Integration](/plugins/Coil3Integration) - Provides a [Coil3](https://github.com/coil-kt/coil) Integration for displaying images stored in Supabase Storage. Supports all Compose Multiplatform targets.
126-
- *[Compose-ImageLoader Integration](/plugins/ImageLoaderIntegration) - Deprecated. Use Coil 3 or create your own integration*
123+
There are several plugins available to extend the functionality of supabase-kt. They can be installed in the `createSupabaseClient` function.
124+
125+
Some highlights include:
126+
127+
- [Apollo GraphQL integration](https://github.com/supabase-community/supabase-kt-plugins/tree/main/ApolloGraphQL) - Creates an [Apollo GraphQL Client](https://github.com/apollographql/apollo-kotlin) for interacting with the Supabase API.
128+
- [Compose Auth](https://github.com/supabase-community/supabase-kt-plugins/tree/main/ComposeAuth) - Provides easy Native Google & Apple Auth for Compose Multiplatform targets.
129+
- [Compose Auth UI](https://github.com/supabase-community/supabase-kt-plugins/tree/main/ComposeAuthUI) - Provides UI Components for Compose Multiplatform.
130+
- [Coil3 Integration](https://github.com/supabase-community/supabase-kt-plugins/tree/main/Coil3Integration) - Provides a [Coil3](https://github.com/coil-kt/coil) Integration for displaying images stored in Supabase Storage. Supports all Compose Multiplatform targets.
131+
132+
For more information, checkout [supabase-kt-plugins](https://github.com/supabase-community/supabase-kt-plugins).
127133

128134
### Miscellaneous
129135
- [Supabase Edge Functions Kotlin](https://github.com/manriif/supabase-edge-functions-kt) - Build, serve and deploy Supabase Edge Functions with Kotlin and Gradle.

Realtime/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ kotlin {
1414
defaultConfig()
1515
allTargets()
1616
sourceSets {
17-
val commonMain by getting {
17+
commonMain {
1818
dependencies {
1919
addModules(SupabaseModule.AUTH)
2020
api(project(":postgrest-kt"))
2121
api(libs.ktor.client.websockets)
2222
}
2323
}
24-
val commonTest by getting {
24+
commonTest {
2525
dependencies {
2626
implementation(project(":test-common"))
2727
implementation(libs.bundles.testing)

Storage/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ kotlin {
2020
}
2121
allTargets()
2222
sourceSets {
23-
val commonMain by getting {
23+
commonMain {
2424
dependencies {
2525
addModules(SupabaseModule.AUTH)
2626
}
2727
}
28-
val commonTest by getting {
28+
commonTest {
2929
dependencies {
3030
implementation(project(":test-common"))
3131
implementation(libs.bundles.testing)

Supabase/build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ kotlin {
3737
defaultConfig()
3838
allTargets()
3939
sourceSets {
40-
val commonMain by getting {
40+
commonMain {
4141
kotlin.srcDir(
4242
// convert the task to a file-provider
4343
buildConfigGenerator.map { it.destinationDir }
@@ -50,12 +50,12 @@ kotlin {
5050
api(libs.kotlinx.atomicfu)
5151
}
5252
}
53-
val commonTest by getting {
53+
commonTest {
5454
dependencies {
5555
implementation(libs.bundles.testing)
5656
}
5757
}
58-
val androidMain by getting {
58+
androidMain {
5959
dependencies {
6060
api(libs.android.lifecycle.process)
6161
}

buildSrc/src/main/kotlin/Modules.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ import org.jetbrains.compose.desktop.DesktopExtension
22
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
33
import org.jetbrains.kotlin.gradle.plugin.KotlinDependencyHandler
44

5-
enum class SupabaseModule(val module: String) {
5+
enum class SupabaseModule(val module: String, val extern: Boolean = false) {
66
SUPABASE("supabase-kt"),
77
AUTH("auth-kt"),
88
STORAGE("storage-kt"),
99
REALTIME("realtime-kt"),
1010
FUNCTIONS("functions-kt"),
1111
POSTGREST("postgrest-kt"),
12-
COMPOSE_AUTH("plugins:compose-auth"),
13-
COMPOSE_AUTH_UI("plugins:compose-auth-ui"),
1412
}
1513

1614
fun KotlinDependencyHandler.addModules(vararg modules: SupabaseModule) {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@ org.jetbrains.compose.experimental.jscanvas.enabled=true
1111
org.jetbrains.compose.experimental.wasm.enabled=true
1212
org.jetbrains.dokka.experimental.gradle.pluginMode=V2Enabled
1313

14-
supabase-version = 3.2.0-rc-1
14+
supabase-version = 3.2.0
1515
base-group = io.github.jan-tennert.supabase

gradle/libs.versions.toml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ktor = "3.2.0"
55
dokka = "2.0.0"
66
kotlinx-datetime = "0.7.0"
77
kermit = "2.0.6"
8-
atomicfu = "0.28.0"
8+
atomicfu = "0.29.0"
99
coroutines = "1.10.2"
1010
android-lifecycle = "2.9.1"
1111
androidx-startup = "1.2.0"
@@ -14,20 +14,15 @@ multiplatform-settings = "1.3.0"
1414
complete-kotlin = "1.1.0"
1515
agp = "8.9.2"
1616
maven-publish = "0.33.0"
17-
apollo-kotlin = "4.3.0"
17+
apollo-kotlin = "4.3.1"
1818
#korlibs = "6.0.0"
1919
detekt = "1.23.8"
2020
moshi = "1.15.2"
2121
jackson = "2.19.1"
2222
browser = "1.8.0"
23-
googleid = "1.1.1"
24-
compose = "1.8.1"
25-
androidsvg = "1.4"
26-
imageloader = "1.9.0"
23+
compose = "1.8.2"
2724
coil2 = "2.7.0"
28-
coil3 = "3.2.0"
29-
okio = "3.13.0"
30-
credentials = "1.5.0"
25+
okio = "3.14.0"
3126
koin = "4.0.4"
3227
androidx-core = "1.16.0"
3328
androidx-compat = "1.7.1"
@@ -49,7 +44,6 @@ detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
4944
compose-plugin = { id = "org.jetbrains.compose", version.ref = "compose" }
5045
compose-compiler = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
5146

52-
native-cocoapods = { id = "org.jetbrains.kotlin.native.cocoapods", version.ref = "kotlin" }
5347
kotlinx-atomicfu = { id = "org.jetbrains.kotlinx.atomicfu", version.ref = "atomicfu" }
5448
power-assert = { id = "org.jetbrains.kotlin.plugin.power-assert", version.ref = "kotlin" }
5549

@@ -58,7 +52,6 @@ kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version.ref = "a
5852
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
5953
kotlinx-browser = { module = "org.jetbrains.kotlinx:kotlinx-browser", version.ref = "kotlinx-browser" }
6054
kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "coroutines" }
61-
kotlinx-coroutines-play-services = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-play-services", version.ref = "coroutines" }
6255
kotlinx-coroutines-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines" }
6356
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
6457
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
@@ -92,9 +85,6 @@ androidx-core = { module = "androidx.core:core-ktx", version.ref = "androidx-cor
9285
androidx-compat = { module = "androidx.appcompat:appcompat", version.ref = "androidx-compat" }
9386
androidx-lifecycle-viewmodel-ktx = { module = "androidx.lifecycle:lifecycle-viewmodel-ktx", version.ref = "androidx-lifecycle" }
9487
androidx-lifecycle-viewmodel-compose = { module = "androidx.lifecycle:lifecycle-viewmodel-compose", version.ref = "androidx-lifecycle" }
95-
android-google-id = { module = "com.google.android.libraries.identity.googleid:googleid", version.ref = "googleid" }
96-
androidx-credentials = { module = "androidx.credentials:credentials", version.ref = "credentials" }
97-
androidx-credentials-play-services = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "credentials" }
9888
multiplatform-settings-no-arg = { module = "com.russhwolf:multiplatform-settings-no-arg", version.ref = "multiplatform-settings" }
9989
multiplatform-settings-coroutines = { module = "com.russhwolf:multiplatform-settings-coroutines", version.ref = "multiplatform-settings" }
10090
multiplatform-settings-test = { module = "com.russhwolf:multiplatform-settings-test", version.ref = "multiplatform-settings" }
@@ -111,13 +101,9 @@ moshi-kotlin = { module = "com.squareup.moshi:moshi-kotlin", version.ref = "mosh
111101
jackson = { module = "com.fasterxml.jackson.core:jackson-core", version.ref = "jackson" }
112102
jackson-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson" }
113103

114-
androidsvg = { module = "com.caverock:androidsvg-aar", version.ref = "androidsvg" }
115-
turbine = { module = "app.cash.turbine:turbine", version = "1.2.0" }
104+
turbine = { module = "app.cash.turbine:turbine", version = "1.2.1" }
116105

117-
coil3 = { module = "io.coil-kt.coil3:coil", version.ref = "coil3" }
118-
coil3-network-core = { module = "io.coil-kt.coil3:coil-network-core", version.ref = "coil3" }
119106
coil2 = { module = "io.coil-kt:coil", version.ref = "coil2" }
120-
imageloader = { module = "io.github.qdsfdhvh:image-loader", version.ref = "imageloader" }
121107

122108
# Sample dependencies
123109
koin-core = { module = "io.insert-koin:koin-core", version.ref = "koin" }
@@ -134,4 +120,3 @@ multiplatform-settings = ["multiplatform-settings-no-arg", "multiplatform-settin
134120
testing = ["kotlinx-coroutines-test", "multiplatform-settings-test", "ktor-client-mock", "kotlin-test"]
135121
moshi = ["moshi", "moshi-kotlin"]
136122
jackson = ["jackson", "jackson-kotlin"]
137-
coil3 = ["coil3", "coil3-network-core"]

0 commit comments

Comments
 (0)