Skip to content

A Kotlin Multiplatform Client for Supabase. Can be used for apps written with jetpack compose desktop, android and web

License

Notifications You must be signed in to change notification settings

hieuwu/supabase-kt

 
 

Repository files navigation

supabase-kt

A Kotlin Multiplatform Client for Supabase.

For information about supported Kotlin targets, see the corresponding module README.

Migrating from version 1.4.X to 2.0.0

Note: WASM build available: 2.4.2-wasm0

Kotlin https://img.shields.io/badge/ktor-2.3.11-blue slack

Links

Documentation

Getting started with Android and Supabase [Video]

Quickstart

Tutorial: Build a Product Management Android App with Jetpack Compose

Dokka documentation for the latest version

Troubleshooting

Installation

Add one or more modules to your project

Available modules: gotrue-kt, postgrest-kt, functions-kt, storage-kt, realtime-kt, apollo-graphql, compose-auth, compose-auth-ui, coil-integration, imageloader-integration

dependencies {
    implementation("io.github.jan-tennert.supabase:[module]:VERSION")
}

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]")

Add a Ktor Client Engine to each of your Kotlin targets

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:

https://img.shields.io/badge/ktor-2.3.11-blue

Main Modules

Plugins

Miscellaneous

Samples

Need help?

Videos

Contribution

Checkout the contribution guidelines for more information.

Credits

About

A Kotlin Multiplatform Client for Supabase. Can be used for apps written with jetpack compose desktop, android and web

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Kotlin 100.0%