A Kotlin Multiplatform Client for Supabase.
For information about supported Kotlin targets, see the corresponding module README.
Migrating from version 2.X to 3.0.0
Note: The WASM-JS
target for supported modules is only available for version 3.0.0 and above
Getting started with Android and Supabase [Video]
Tutorial: Build a Product Management Android App with Jetpack Compose
Dokka documentation for the latest version
Available modules: auth-kt
*, postgrest-kt
, functions-kt
,
storage-kt
, realtime-kt
, apollo-graphql
, compose-auth
,
compose-auth-ui
, coil-integration
, coil3-integration
, imageloader-integration
dependencies {
implementation("io.github.jan-tennert.supabase:[module]:VERSION")
}
* Before version 3.0.0, the module was called gotrue-kt
.
If you use multiple modules, you can use the bom dependency to get the correct versions for all modules:
implementation(platform("io.github.jan-tennert.supabase:bom:VERSION"))
implementation("io.github.jan-tennert.supabase:[module]")
Note that the minimum Android SDK version is 26. For lower versions, you need to enable core library desugaring.
You can find a list of available engines here. If you plan to use the Realtime dependency, make sure to check if the engine supports WebSockets. See the Ktor docs for more information.
implementation("io.ktor:ktor-client-[engine]:VERSION")
Multiplatform Example
For targets: jvm
, android
, js
, ios
val commonMain by getting {
dependencies {
//supabase modules
}
}
val jvmMain by getting {
dependencies {
implementation("io.ktor:ktor-client-cio:KTOR_VERSION")
}
}
val androidMain by getting {
dependsOn(jvmMain)
}
val jsMain by getting {
dependencies {
implementation("io.ktor:ktor-client-js:KTOR_VERSION")
}
}
val iosMain by getting {
dependencies {
implementation("io.ktor:ktor-client-darwin:KTOR_VERSION")
}
}
Note: It is recommended to use the same Ktor version as supabase-kt:
- Apollo GraphQL integration - Creates an Apollo GraphQL Client for interacting with the Supabase API.
- Compose Auth - Provides easy Native Google & Apple Auth for Compose Multiplatform targets.
- Compose Auth UI - Provides UI Components for Compose Multiplatform.
- Coil Integration - Provides a Coil2 Integration for displaying images stored in Supabase Storage. Only supports Android.
- Coil3 Integration - Provides a Coil3 Integration for displaying images stored in Supabase Storage. Supports all Compose Multiplatform targets.
- Compose-ImageLoader Integration - Provides a Compose ImageLoader Integration for displaying images stored in Supabase Storage.
- Supabase Edge Functions Kotlin - Build, serve and deploy Supabase Edge Functions with Kotlin and Gradle.
Official Samples
- Chat Demo (Desktop/Android/iOS/Browser) - A simple chat application using the Auth, Postgrest and Realtime module.
- File Upload Demo (Desktop/Android) - A simple bulk file upload application using the Storage module.
- Multi-Factor Authentication (Desktop/Android/Browser) - A simple application showcasing Multi-Factor Authentication.
Community Samples
- Groceries Store App (Android)
Community Samples
- RESTful Service (Spring Boot)
- Join the #supabase-kt Kotlin Slack channel
- Join the Supabase Discord and create a new post with the 'Kotlin' tag under
help-and-questions
- Create a discussion
- Create an issue
- Getting started with Android and Supabase by the official Supabase YouTube channel
- Sign in with Google on Android using Credential Manager by the official Supabase YouTube channel
- Getting started with Supabase on Android (by Eric Ampire)
- Supabase | Jetpack Compose | Android | 2023 (by YoursSohailYT)
Checkout the contribution guidelines for more information.
- Postgres Syntax inspired by https://github.com/supabase-community/postgrest-kt
- Plugin system inspired by ktor
If you like the project and want to support it, consider sponsoring me on Ko-fi or directly on PayPal.