Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Update introduction & installing

Jan Tennerta6b6be7eb308
diff --git a/apps/docs/docs/ref/kotlin/installing.mdx b/apps/docs/docs/ref/kotlin/installing.mdx
index 8d341ad0f63..115123698fe 100644
--- a/apps/docs/docs/ref/kotlin/installing.mdx
+++ b/apps/docs/docs/ref/kotlin/installing.mdx
@@ -150,28 +150,28 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
```kotlin
val commonMain by getting {
- dependencies {
- //supabase modules
- }
- }
+ dependencies {
+ //supabase modules
+ }
+ }
val jvmMain by getting {
- dependencies {
- implementation("io.ktor:ktor-client-cio:KTOR_VERSION")
- }
- }
+ dependencies {
+ implementation("io.ktor:ktor-client-cio:KTOR_VERSION")
+ }
+ }
val androidMain by getting {
- dependsOn(jvmMain)
- }
+ dependsOn(jvmMain)
+ }
val jsMain by getting {
- dependencies {
- implementation("io.ktor:ktor-client-js:KTOR_VERSION")
- }
- }
+ dependencies {
+ implementation("io.ktor:ktor-client-js:KTOR_VERSION")
+ }
+ }
val iosMain by getting {
- dependencies {
- implementation("io.ktor:ktor-client-darwin:KTOR_VERSION")
- }
- }
+ dependencies {
+ implementation("io.ktor:ktor-client-darwin:KTOR_VERSION")
+ }
+ }
```
</TabPanel>
@@ -181,12 +181,18 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
</RefSubLayout.EducationRow>
-### Add KotlinX Serialization (required for PostgREST and Realtime serialization)
+### Serialization
+
+supabase-kt provides several different ways to encode and decode your custom objects.
+By default, [KotlinX Serialization](https://github.com/Kotlin/kotlinx.serialization) is used.
<RefSubLayout.EducationRow>
- <RefSubLayout.Examples>
+ <RefSubLayout.Details>
+
+ Use [KotlinX Serialization](https://github.com/Kotlin/kotlinx.serialization).
- Add the serialization plugin
+ </RefSubLayout.Details>
+ <RefSubLayout.Examples>
<Tabs
size="small"
@@ -196,8 +202,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
```kotlin
plugins {
- kotlin("plugin.serialization") version "KOTLIN_VERSION"
- }
+ kotlin("plugin.serialization") version "KOTLIN_VERSION"
+ }
```
</TabPanel>
@@ -205,8 +211,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
```groovy
plugins {
- id 'org.jetbrains.kotlin.plugin.serialization' version 'KOTLIN_VERSION'
- }
+ id 'org.jetbrains.kotlin.plugin.serialization' version 'KOTLIN_VERSION'
+ }
```
</TabPanel>
@@ -247,20 +253,134 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
</TabPanel>
</Tabs>
+ ```kotlin
+ val client = createSupabaseClient(supabaseUrl, supabaseKey) {
+ //Already the default serializer
+ }
+ ```
+ </RefSubLayout.Examples>
+
+</RefSubLayout.EducationRow>
+<RefSubLayout.EducationRow>
+ <RefSubLayout.Details>
+
+ Use [Moshi](https://github.com/square/moshi).
+
+ </RefSubLayout.Details>
+ <RefSubLayout.Examples>
+
+ <Tabs
+ size="small"
+ type="underlined"
+ defaultActiveId="kotlin">
+ <TabPanel id="kotlin" label="build.gradle.kts">
+
+ ```kotlin
+ implementation("io.github.jan-tennert.supabase:serializer-moshi:VERSION")
+ ```
- Now you can create serializable classes in your project:
+ </TabPanel>
+ <TabPanel id="groovy" label="build.gradle">
+
+ ```groovy
+ implementation 'io.github.jan-tennert.supabase:serializer-moshi:VERSION'
+ ```
+
+ </TabPanel>
+ <TabPanel id="xml" label="pom.xml">
+
+ ```xml
+ <dependency>
+ <groupId>io.github.jan-tennert.supabase</groupId>
+ <artifactId>serializer-moshi</artifactId>
+ <version>VERSION</version>
+ </dependency>
+ ```
+
+ </TabPanel>
+ </Tabs>
```kotlin
- @Serializable
- data class Message(
- val id: Int,
- val content: String,
- @SerialName("author_id")
- val authorId: String
- )
+ val client = createSupabaseClient(supabaseUrl, supabaseKey) {
+ defaultSerializer = MoshiSerializer()
+ }
```
- And use them in your Supabase queries:
+
+ </RefSubLayout.Examples>
+
+</RefSubLayout.EducationRow>
+<RefSubLayout.EducationRow>
+ <RefSubLayout.Details>
+
+ Use [Jackson](https://github.com/FasterXML/jackson-module-kotlin).
+
+ </RefSubLayout.Details>
+ <RefSubLayout.Examples>
+
+ <Tabs
+ size="small"
+ type="underlined"
+ defaultActiveId="kotlin">
+ <TabPanel id="kotlin" label="build.gradle.kts">
+
+ ```kotlin
+ implementation("io.github.jan-tennert.supabase:serializer-jackson:VERSION")
+ ```
+
+ </TabPanel>
+ <TabPanel id="groovy" label="build.gradle">
+
+ ```groovy
+ implementation 'io.github.jan-tennert.supabase:serializer-jackson:VERSION'
+ ```
+
+ </TabPanel>
+ <TabPanel id="xml" label="pom.xml">
+
+ ```xml
+ <dependency>
+ <groupId>io.github.jan-tennert.supabase</groupId>
+ <artifactId>serializer-jackson</artifactId>
+ <version>VERSION</version>
+ </dependency>
+ ```
+
+ </TabPanel>
+ </Tabs>
+ ```kotlin
+ val client = createSupabaseClient(supabaseUrl, supabaseKey) {
+ defaultSerializer = JacksonSerializer()
+ }
+ ```
+
+ </RefSubLayout.Examples>
+
+</RefSubLayout.EducationRow>
+<RefSubLayout.EducationRow>
+ <RefSubLayout.Details>
+
+ Use custom serializer.
+
+ </RefSubLayout.Details>
+ <RefSubLayout.Examples>
+
+ ```kotlin
+ class CustomSerializer: SupabaseSerializer {
+
+ override fun <T : Any> encode(type: KType, value: T): String {
+ //encode value to string
+ }
+
+ override fun <T : Any> decode(type: KType, value: String): T {
+ //decode value
+ }
+
+ }
+ ```
+
```kotlin
- val messages = client.postgrest["messages"].select().decodeList<Message>()
+ val client = createSupabaseClient(supabaseUrl, supabaseKey) {
+ defaultSerializer = CustomSerializer()
+ }
```
</RefSubLayout.Examples>
diff --git a/apps/docs/docs/ref/kotlin/introduction.mdx b/apps/docs/docs/ref/kotlin/introduction.mdx
index 36be6dd7a89..a47a06b9e5f 100644
--- a/apps/docs/docs/ref/kotlin/introduction.mdx
+++ b/apps/docs/docs/ref/kotlin/introduction.mdx
@@ -5,29 +5,42 @@ hideTitle: true
---
<div className="flex items-start gap-6 not-prose" id="introduction">
- <IconMenuKotlin width={35} height={35} />
- <div className="flex flex-col gap-2">
- <h1 className="text-3xl text-scale-1200 m-0">Kotlin Client Library</h1>
- <h2 className="text-base font-mono text-scale-1100">@supabase-community/supabase-kt</h2>
- </div>
+ <IconMenuKotlin width={35} height={35} />
+ <div className="flex flex-col gap-2">
+ <h1 className="text-3xl text-scale-1200 m-0">Kotlin Client Library</h1>
+ <h2 className="text-base font-mono text-scale-1100">@supabase-community/supabase-kt</h2>
+ </div>
</div>
<div className="max-w-xl">
-This reference documents every object and method available in Supabase's Kotlin Multiplatform library, [supabase-kt](https://github.com/supabase-community/supabase-kt). You can use supabase-kt to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files.
+ This reference documents every object and method available in Supabase's Kotlin Multiplatform library, [supabase-kt](https://github.com/supabase-community/supabase-kt). You can use supabase-kt to interact with your Postgres database, listen to database changes, invoke Deno Edge Functions, build login and user management functionality, and manage large files.
-Supported Kotlin targets:
+ Supported Kotlin targets:
-- JVM
-- Android
-- iOS (Experimental)
-- JS (Browser)
+ | **Module** | **GoTrue** | **Realtime** | **Postgrest** | **Storage** | **Functions** | **Apollo-GraphQL** |
+ | --------------------------------------- | ---------- | ------------ | ------------- | ---------- | ------------- |------------------ |
+ | **JVM** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
+ | **Android** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
+ | **JS** *(Browser)* | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
+ | **IOS** | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
+ | **MacOS** *(macosX64 & macosArm64)* 🚧 | ✅ | ✅ | ✅ | ✅ | ✅ | ✅ |
+ | **Windows** *(mingwX64)* 🚧 | ☑️ | ✅ | ✅ | ✅ | ✅ | ❌ |
+ | **Linux** *(linuxX64)* 🚧 | ☑️ | ✅ | ✅ | ✅ | ✅ | ❌ |
+
+ ✅ = full support
+
+ ☑️ = partial support: no built-in OAuth/OTP link handling. Linux also has no persistent session storage.
+
+ 🚧 = experimental/needs feedback
+
+ ❌ = not supported
</div>
<div className="max-w-xl bg-slate-300 px-4 py-2 rounded-md">
- <p>The Kotlin client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues.</p>
+ <p>The Kotlin client library is created and maintained by the Supabase community, and is not an official library. Please be tolerant of areas where the library is still being developed, and — as with all the libraries — feel free to contribute wherever you find issues.</p>
-<p>Huge thanks to official maintainer, [jan-tennert](https://github.com/jan-tennert).</p>
+ <p>Huge thanks to official maintainer, [jan-tennert](https://github.com/jan-tennert).</p>
</div>
diff --git a/spec/supabase_kt_v0.yml b/spec/supabase_kt_v0.yml
index ebac308c3fb..5d25cf21a5b 100644
--- a/spec/supabase_kt_v0.yml
+++ b/spec/supabase_kt_v0.yml
@@ -133,7 +133,7 @@ functions:
description: |
`transferTimeout` - the timeout for uploading and downloading files. Default: `120.seconds`
- `resumable.cache` - Interface for storing resumable upload urls. Default: `ResumableCache.Disk`
+ `resumable.cache` - Interface for storing resumable upload urls. Default: `SettingsResumableCache`
`resumable.defaultChunkSize` - The default chunk size for resumable uploads. Supabase currently only supports a chunk size of 6MB, so be careful when changing this value. Default: `6MB`