mirror of
https://github.com/supabase/supabase.git
synced 2026-12-06 08:29:01 +00:00
docs(ref): add Kotlin v4 alpha reference (#54384)
## This PR - Adds a v4 alpha reference for Kotlin at `/reference/kotlin/v4`, using the prerelease flag from #53896. - v3 stays the default at `/reference/kotlin`. v4 shows the alpha notice and is listed under "Prereleases" in the version menu. - `spec/supabase_kt_v4.yml` is the v3 spec with links updated to `supabase/supabase-kt`. The API is the same in v4. - New `introduction`, `installing` (with `io.supabase` coordinates) and `upgrade-guide` pages under `docs/ref/kotlin/v4/`. ## Why - supabase-kt `4.0.0-alpha-1` is on Maven Central. It's the first official release of the Kotlin SDK and moves it to the `io.supabase` Maven group and package. The current reference only shows the v3 coordinates. ## Note - Guides, quickstarts and the existing v3 pages are unchanged. They switch to `io.supabase` with the stable 4.0.0 release. - Search doesn't index prerelease versions yet, same as Swift v3. - I didn't run the docs build locally. Please check `/docs/reference/kotlin/v4` and `/docs/reference/kotlin/v4/upgrade-guide` on the preview. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Safa <4990386+safaorhan@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
8 files changed
+7299
-3
No files matched your search
@@ -3663,6 +3663,17 @@ export const reference_kotlin_v3 = {
|
||||
},
|
||||
}
|
||||
|
||||
export const reference_kotlin_v4 = {
|
||||
icon: 'reference-kotlin',
|
||||
title: 'kotlin',
|
||||
url: 'guides/reference/kotlin',
|
||||
parent: '/reference',
|
||||
pkg: {
|
||||
name: 'supabase-kt',
|
||||
repo: 'https://github.com/supabase/supabase-kt',
|
||||
},
|
||||
}
|
||||
|
||||
export const reference_cli = {
|
||||
icon: 'reference-cli',
|
||||
title: 'Supabase CLI',
|
||||
|
||||
@@ -43,6 +43,7 @@ enum MenuId {
|
||||
RefKotlinV1 = 'reference_kotlin_v1',
|
||||
RefKotlinV2 = 'reference_kotlin_v2',
|
||||
RefKotlinV3 = 'reference_kotlin_v3',
|
||||
RefKotlinV4 = 'reference_kotlin_v4',
|
||||
RefCli = 'reference_cli',
|
||||
RefApi = 'reference_api',
|
||||
SelfHostingAuth = 'reference_self_hosting_auth',
|
||||
@@ -231,6 +232,11 @@ const menus: Menu[] = [
|
||||
type: 'reference',
|
||||
path: '/reference/kotlin',
|
||||
},
|
||||
{
|
||||
id: MenuId.RefKotlinV4,
|
||||
type: 'reference',
|
||||
path: '/reference/kotlin/v4',
|
||||
},
|
||||
{
|
||||
id: MenuId.RefCli,
|
||||
type: 'reference',
|
||||
|
||||
@@ -146,13 +146,20 @@ export const REFERENCES = {
|
||||
name: 'Kotlin',
|
||||
library: 'supabase-kt',
|
||||
libPath: 'kotlin',
|
||||
versions: ['v3', 'v2', 'v1'],
|
||||
// `versions[0]` is the default. A prerelease version goes after it, so the
|
||||
// stable version keeps the `/reference/kotlin` URL.
|
||||
versions: ['v3', 'v4', 'v2', 'v1'],
|
||||
icon: 'reference-kotlin',
|
||||
meta: {
|
||||
v3: {
|
||||
libId: 'reference_kotlin_v3',
|
||||
specFile: 'supabase_kt_v3',
|
||||
},
|
||||
v4: {
|
||||
libId: 'reference_kotlin_v4',
|
||||
specFile: 'supabase_kt_v4',
|
||||
prerelease: 'alpha',
|
||||
},
|
||||
v2: {
|
||||
libId: 'reference_kotlin_v2',
|
||||
specFile: 'supabase_kt_v2',
|
||||
|
||||
@@ -0,0 +1,432 @@
|
||||
---
|
||||
id: installing
|
||||
title: 'Installing & Initialization'
|
||||
slug: installing
|
||||
custom_edit_url: https://github.com/supabase/supabase/edit/master/apps/docs/docs/ref/kotlin/v4/installing.mdx
|
||||
---
|
||||
|
||||
### Add one or more modules to your project
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
<div style={{ display: 'flex', flexDirection: 'row', alignItems: 'center' }}>
|
||||
<a href="https://github.com/supabase/supabase-kt/releases">
|
||||
<img src="https://img.shields.io/maven-central/v/io.supabase/supabase-kt?label=alpha" alt="latest supabase-kt v4 version"/>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
v4 is published under the `io.supabase` Maven group. Add dependency to your build file using the BOM.
|
||||
|
||||
The available modules are:
|
||||
- [**auth-kt**](https://github.com/supabase/supabase-kt/tree/master/Auth)
|
||||
- [**realtime-kt**](https://github.com/supabase/supabase-kt/tree/master/Realtime)
|
||||
- [**storage-kt**](https://github.com/supabase/supabase-kt/tree/master/Storage)
|
||||
- [**functions-kt**](https://github.com/supabase/supabase-kt/tree/master/Functions)
|
||||
- [**postgrest-kt**](https://github.com/supabase/supabase-kt/tree/master/Postgrest)
|
||||
- Other plugins also available [here](https://github.com/supabase/supabase-kt/tree/master/plugins)
|
||||
|
||||
Check out the different READMEs for information about supported Kotlin targets.
|
||||
|
||||
*Note that the minimum Android SDK version is 26. For lower versions, you need to enable [core library desugaring](https://developer.android.com/studio/write/java8-support#library-desugaring).*
|
||||
|
||||
</RefSubLayout.Details>
|
||||
<RefSubLayout.Examples>
|
||||
<Tabs
|
||||
size="small"
|
||||
type="underlined"
|
||||
defaultActiveId="kotlin"
|
||||
queryGroup="build-file"
|
||||
>
|
||||
<TabPanel id="kotlin" label="build.gradle.kts">
|
||||
|
||||
```kotlin
|
||||
implementation(platform("io.supabase:bom:4.0.0-alpha-1"))
|
||||
implementation("io.supabase:postgrest-kt")
|
||||
implementation("io.supabase:auth-kt")
|
||||
implementation("io.supabase:realtime-kt")
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="groovy" label="build.gradle">
|
||||
|
||||
```groovy
|
||||
implementation platform("io.supabase:bom:4.0.0-alpha-1")
|
||||
implementation 'io.supabase:postgrest-kt'
|
||||
implementation 'io.supabase:auth-kt'
|
||||
implementation 'io.supabase:realtime-kt'
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="xml" label="pom.xml">
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.supabase</groupId>
|
||||
<artifactId>bom</artifactId>
|
||||
<version>4.0.0-alpha-1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.supabase</groupId>
|
||||
<artifactId>postgrest-kt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.supabase</groupId>
|
||||
<artifactId>auth-kt</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.supabase</groupId>
|
||||
<artifactId>realtime-kt</artifactId>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
</RefSubLayout.Examples>
|
||||
|
||||
</RefSubLayout.EducationRow>
|
||||
|
||||
### Add Ktor Client Engine to each of your Kotlin targets (required)
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
You can find a list of engines [here](https://ktor.io/docs/http-client-engines.html)
|
||||
- Note that not all Ktor engines support WebSockets. So if you plan to use the Realtime module, make sure to use an engine that supports WebSockets. Check out the [engine limitations](https://ktor.io/docs/client-engines.html#limitations) for more information.
|
||||
- supabase-kt v4 uses Ktor 3, so use a Ktor 3 engine.
|
||||
|
||||
</RefSubLayout.Details>
|
||||
<RefSubLayout.Examples>
|
||||
<Tabs
|
||||
size="small"
|
||||
type="underlined"
|
||||
defaultActiveId="kotlin"
|
||||
queryGroup="build-file"
|
||||
>
|
||||
<TabPanel id="kotlin" label="build.gradle.kts">
|
||||
|
||||
```kotlin
|
||||
implementation("io.ktor:ktor-client-[engine]:KTOR_VERSION")
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="groovy" label="build.gradle">
|
||||
|
||||
```groovy
|
||||
implementation 'io.ktor:ktor-client-[engine]:KTOR_VERSION'
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="xml" label="pom.xml">
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.ktor</groupId>
|
||||
<artifactId>ktor-client-[engine]</artifactId>
|
||||
<version>KTOR_VERSION</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
</RefSubLayout.Examples>
|
||||
|
||||
</RefSubLayout.EducationRow>
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
Multiplatform example:
|
||||
|
||||
</RefSubLayout.Details>
|
||||
<RefSubLayout.Examples>
|
||||
|
||||
<Tabs
|
||||
size="small"
|
||||
type="underlined"
|
||||
defaultActiveId="kotlin"
|
||||
queryGroup="build-file"
|
||||
>
|
||||
<TabPanel id="kotlin" label="build.gradle.kts">
|
||||
|
||||
```kotlin
|
||||
commonMain {
|
||||
dependencies {
|
||||
//Supabase modules
|
||||
}
|
||||
}
|
||||
jvmMain {
|
||||
dependencies {
|
||||
implementation("io.ktor:ktor-client-cio:KTOR_VERSION")
|
||||
}
|
||||
}
|
||||
androidMain {
|
||||
dependsOn(jvmMain.get())
|
||||
}
|
||||
jsMain {
|
||||
dependencies {
|
||||
implementation("io.ktor:ktor-client-js:KTOR_VERSION")
|
||||
}
|
||||
}
|
||||
iosMain {
|
||||
dependencies {
|
||||
implementation("io.ktor:ktor-client-darwin:KTOR_VERSION")
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
|
||||
</RefSubLayout.Examples>
|
||||
|
||||
</RefSubLayout.EducationRow>
|
||||
|
||||
### 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.Details>
|
||||
|
||||
Use [KotlinX Serialization](https://github.com/Kotlin/kotlinx.serialization).
|
||||
|
||||
</RefSubLayout.Details>
|
||||
<RefSubLayout.Examples>
|
||||
|
||||
<Tabs
|
||||
size="small"
|
||||
type="underlined"
|
||||
defaultActiveId="kotlin"
|
||||
queryGroup="build-file"
|
||||
>
|
||||
<TabPanel id="kotlin" label="build.gradle.kts">
|
||||
|
||||
```kotlin
|
||||
plugins {
|
||||
kotlin("plugin.serialization") version "KOTLIN_VERSION"
|
||||
}
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="groovy" label="build.gradle">
|
||||
|
||||
```groovy
|
||||
plugins {
|
||||
id 'org.jetbrains.kotlin.plugin.serialization' version 'KOTLIN_VERSION'
|
||||
}
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="xml" label="pom.xml">
|
||||
|
||||
```xml
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-plugin</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>compile</id>
|
||||
<phase>compile</phase>
|
||||
<goals>
|
||||
<goal>compile</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
<configuration>
|
||||
<compilerPlugins>
|
||||
<plugin>kotlinx-serialization</plugin>
|
||||
</compilerPlugins>
|
||||
</configuration>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-maven-serialization</artifactId>
|
||||
<version>${kotlin.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
```kotlin
|
||||
val supabase = createSupabaseClient(supabaseUrl, supabaseKey) {
|
||||
//Already the default serializer, but you can provide a custom Json instance (optional):
|
||||
defaultSerializer = KotlinXSerializer(Json {
|
||||
//apply your custom config
|
||||
})
|
||||
}
|
||||
```
|
||||
</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"
|
||||
queryGroup="build-file"
|
||||
>
|
||||
<TabPanel id="kotlin" label="build.gradle.kts">
|
||||
|
||||
```kotlin
|
||||
implementation("io.supabase:serializer-moshi:4.0.0-alpha-1")
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="groovy" label="build.gradle">
|
||||
|
||||
```groovy
|
||||
implementation 'io.supabase:serializer-moshi:4.0.0-alpha-1'
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="xml" label="pom.xml">
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.supabase</groupId>
|
||||
<artifactId>serializer-moshi</artifactId>
|
||||
<version>4.0.0-alpha-1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
```kotlin
|
||||
val supabase = createSupabaseClient(supabaseUrl, supabaseKey) {
|
||||
defaultSerializer = MoshiSerializer()
|
||||
}
|
||||
```
|
||||
|
||||
</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"
|
||||
queryGroup="build-file"
|
||||
>
|
||||
<TabPanel id="kotlin" label="build.gradle.kts">
|
||||
|
||||
```kotlin
|
||||
implementation("io.supabase:serializer-jackson:4.0.0-alpha-1")
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="groovy" label="build.gradle">
|
||||
|
||||
```groovy
|
||||
implementation 'io.supabase:serializer-jackson:4.0.0-alpha-1'
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
<TabPanel id="xml" label="pom.xml">
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.supabase</groupId>
|
||||
<artifactId>serializer-jackson</artifactId>
|
||||
<version>4.0.0-alpha-1</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
</TabPanel>
|
||||
</Tabs>
|
||||
```kotlin
|
||||
val supabase = 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 supabase = createSupabaseClient(supabaseUrl, supabaseKey) {
|
||||
defaultSerializer = CustomSerializer()
|
||||
}
|
||||
```
|
||||
|
||||
</RefSubLayout.Examples>
|
||||
|
||||
</RefSubLayout.EducationRow>
|
||||
|
||||
### Enable Data API access
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
supabase-kt uses the Data API to query and mutate your Postgres data. You first need to grant Data API roles permissions to access your tables and functions.
|
||||
|
||||
In [Data API integrations settings](/dashboard/project/_/integrations/data_api/settings), expose the specific tables and functions you want to access. To automatically grant access for new tables and functions in `public`, enable **Default privileges for new entities**.
|
||||
|
||||
Alternatively, use SQL to grant the required permissions:
|
||||
|
||||
</RefSubLayout.Details>
|
||||
|
||||
<RefSubLayout.Examples>
|
||||
|
||||
```sql
|
||||
-- Before granting access to client roles, make sure RLS is enabled
|
||||
-- and create the policies required for each role's allowed operations.
|
||||
alter table public.your_table enable row level security;
|
||||
-- create policy ... on public.your_table ...;
|
||||
|
||||
-- Grant least-privilege access to tables after RLS and policies are in place
|
||||
grant select on public.your_table to anon;
|
||||
grant select, insert, update, delete on public.your_table to authenticated;
|
||||
grant all on public.your_table to service_role;
|
||||
|
||||
-- Grant execute on functions after verifying any table access they rely on
|
||||
grant execute on function public.your_function to authenticated, service_role;
|
||||
```
|
||||
|
||||
</RefSubLayout.Examples>
|
||||
|
||||
</RefSubLayout.EducationRow>
|
||||
@@ -0,0 +1,11 @@
|
||||
This reference documents every object and method available in v4 of Supabase's Kotlin Multiplatform library, [supabase-kt](https://github.com/supabase/supabase-kt). With supabase-kt, you can query and update your Postgres data, listen to database changes, and invoke Deno Edge Functions. You can also sign users up and in, and upload, download, and delete large files.
|
||||
|
||||
v4 is the first official release of supabase-kt, maintained by the Supabase SDK team. It is in alpha. v4 moves the library to the `io.supabase` Maven group and package and keeps the v3 API. To move an app from v3, read the [upgrade guide](/docs/reference/kotlin/v4/upgrade-guide).
|
||||
|
||||
To see supported Kotlin targets, check the corresponding module README on [GitHub](https://github.com/supabase/supabase-kt).
|
||||
|
||||
<Admonition type="note">
|
||||
|
||||
supabase-kt was created and grown by the community. Huge thanks to its original maintainer, [jan-tennert](https://github.com/jan-tennert), and to every contributor.
|
||||
|
||||
</Admonition>
|
||||
@@ -0,0 +1,107 @@
|
||||
---
|
||||
id: upgrade-guide
|
||||
title: Upgrade to supabase-kt v4
|
||||
description: 'Upgrade a Kotlin app from supabase-kt v3 to v4. Move to the io.supabase Maven group and package, upgrade all modules and plugins together, and fix the places the compiler does not check.'
|
||||
---
|
||||
|
||||
Upgrade your app from supabase-kt v3 to v4. v4 is the first official release of supabase-kt. It moves the library to a new Maven group and package and keeps the v3 API, so the upgrade is mostly a find-and-replace.
|
||||
|
||||
For the full details, see the [migration guide](https://github.com/supabase/supabase-kt/blob/master/MIGRATION.md) in the supabase-kt repository on GitHub.
|
||||
|
||||
## What changes
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
The Maven group ID and the package name change:
|
||||
|
||||
- Maven group ID: `io.github.jan-tennert.supabase` is now `io.supabase`.
|
||||
- Package name: `io.github.jan.supabase` is now `io.supabase`.
|
||||
|
||||
Artifact IDs don't change (`auth-kt`, `postgrest-kt`, `storage-kt`, `realtime-kt`, `functions-kt`, `supabase-kt`, `bom`, and the plugins), and neither do the package names below the root. For example, `io.github.jan.supabase.auth.providers` is now `io.supabase.auth.providers`.
|
||||
|
||||
Sessions and other data stored on your users' devices are not affected. v4 reads the sessions, PKCE code verifiers, and resumable upload state saved by v3, so your users stay signed in after you update your app.
|
||||
|
||||
</RefSubLayout.Details>
|
||||
</RefSubLayout.EducationRow>
|
||||
|
||||
## Upgrade the client library
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
Replace the Maven group in your build files, such as `build.gradle.kts` and `libs.versions.toml`. Upgrade **all** supabase-kt modules **and** plugins, such as `compose-auth`, `compose-auth-ui`, and `coil3-integration`, to `4.0.0-alpha-1` at the same time.
|
||||
|
||||
</RefSubLayout.Details>
|
||||
<RefSubLayout.Examples>
|
||||
|
||||
```kotlin
|
||||
// Before
|
||||
implementation(platform("io.github.jan-tennert.supabase:bom:3.9.0"))
|
||||
implementation("io.github.jan-tennert.supabase:auth-kt")
|
||||
// After
|
||||
implementation(platform("io.supabase:bom:4.0.0-alpha-1"))
|
||||
implementation("io.supabase:auth-kt")
|
||||
```
|
||||
|
||||
</RefSubLayout.Examples>
|
||||
</RefSubLayout.EducationRow>
|
||||
|
||||
## Update the package name
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
Replace the group ID and the package name everywhere else in your project. In IntelliJ IDEA or Android Studio, use **Edit > Find > Replace in Files**:
|
||||
|
||||
- `io.github.jan-tennert.supabase` → `io.supabase`
|
||||
- `io.github.jan.supabase` → `io.supabase`
|
||||
|
||||
Or run this command from the root of your project. It works on macOS and Linux.
|
||||
|
||||
</RefSubLayout.Details>
|
||||
<RefSubLayout.Examples>
|
||||
|
||||
```bash
|
||||
grep -rlE --null 'io\.github\.jan(-tennert)?\.supabase' --include='*.kt' --include='*.kts' --include='*.gradle' --include='*.java' --include='*.toml' --include='*.properties' --include='*.xml' --include='*.pro' --include='*.txt' --include='*.swift' . \
|
||||
| xargs -0 perl -pi -e 's/io\.github\.jan-tennert\.supabase/io.supabase/g; s/io\.github\.jan\.supabase/io.supabase/g'
|
||||
```
|
||||
|
||||
</RefSubLayout.Examples>
|
||||
</RefSubLayout.EducationRow>
|
||||
|
||||
## Check the places the compiler does not check
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
Search your project for `io.github.jan` once more. These places still build with the old name but stop working:
|
||||
|
||||
- **ProGuard and R8 rules**, such as `-keep class io.github.jan.supabase.** { *; }`. The rules no longer match, which can cause crashes that only appear in minified release builds.
|
||||
- **`AndroidManifest.xml` overrides** of the SDK's initializers, such as `tools:node="remove"` on `io.github.jan.supabase.auth.SupabaseInitializer`. They are now `io.supabase.auth.SupabaseInitializer` and `io.supabase.storage.SupabaseInitializer`.
|
||||
- **Opt-in compiler arguments** in Gradle files, such as `optIn("io.github.jan.supabase.annotations.SupabaseExperimental")`.
|
||||
- **Strings and reflection** that reference SDK classes by their full name.
|
||||
|
||||
</RefSubLayout.Details>
|
||||
</RefSubLayout.EducationRow>
|
||||
|
||||
## Fix a capability conflict
|
||||
|
||||
<RefSubLayout.EducationRow>
|
||||
<RefSubLayout.Details>
|
||||
|
||||
v4 declares that it replaces the matching v3 module. If a dependency, such as a plugin or a third-party library you haven't upgraded yet, still pulls in a v3 supabase-kt module, Gradle fails with an error like `Cannot select module because of conflict ... Both provide capability 'io.github.jan-tennert.supabase:...'`. This stops two copies of the SDK from ending up in your app.
|
||||
|
||||
To fix it, find the dependency and upgrade it to a version built on supabase-kt v4.
|
||||
|
||||
This check uses Gradle module metadata, so Maven builds don't report the conflict.
|
||||
|
||||
</RefSubLayout.Details>
|
||||
<RefSubLayout.Examples>
|
||||
|
||||
```bash
|
||||
./gradlew :app:dependencies | grep io.github.jan-tennert.supabase
|
||||
```
|
||||
|
||||
</RefSubLayout.Examples>
|
||||
</RefSubLayout.EducationRow>
|
||||
@@ -64,7 +64,8 @@
|
||||
"reference_swift_v3",
|
||||
"reference_kotlin_v1",
|
||||
"reference_kotlin_v2",
|
||||
"reference_kotlin_v3"
|
||||
"reference_kotlin_v3",
|
||||
"reference_kotlin_v4"
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -1770,7 +1771,8 @@
|
||||
"reference_python_v2",
|
||||
"reference_swift_v1",
|
||||
"reference_swift_v2",
|
||||
"reference_kotlin_v3"
|
||||
"reference_kotlin_v3",
|
||||
"reference_kotlin_v4"
|
||||
],
|
||||
"items": [
|
||||
{
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user