Skip to content

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

docs: rename `client` to `supabase` within Kotlin docs (#18905)

Tyler548fa3ed8905
diff --git a/spec/supabase_kt_v0.yml b/spec/supabase_kt_v0.yml
index beb98ea7a3f..1e6d75d30b0 100644
--- a/spec/supabase_kt_v0.yml
+++ b/spec/supabase_kt_v0.yml
@@ -60,12 +60,12 @@ functions:
}
```
4. **Call platform specific function on startup** \
- On Android: `client.handleDeeplinks(intent)` \
- On IOS/MacOS: `client.handleDeeplinks(url)`
+ On Android: `supabase.handleDeeplinks(intent)` \
+ On IOS/MacOS: `supabase.handleDeeplinks(url)`
Then you can just login using OAuth:
```kotlin
- client.gotrue.loginWith(Google)
+ supabase.gotrue.loginWith(Google)
```
Or open OTP links directly in your app.
@@ -83,7 +83,7 @@ functions:
name: Initialize Client
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://xyzcompany.supabase.co",
supabaseKey = "public-anon-key"
) {
@@ -96,7 +96,7 @@ functions:
name: Configure GoTrue module
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://xyzcompany.supabase.co",
supabaseKey = "public-anon-key"
) {
@@ -153,7 +153,7 @@ functions:
name: Configure PostgREST module
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://xyzcompany.supabase.co",
supabaseKey = "public-anon-key"
) {
@@ -175,7 +175,7 @@ functions:
name: Configure Storage module
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://xyzcompany.supabase.co",
supabaseKey = "public-anon-key"
) {
@@ -202,7 +202,7 @@ functions:
name: Configure Realtime module
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://xyzcompany.supabase.co",
supabaseKey = "public-anon-key"
) {
@@ -229,7 +229,7 @@ functions:
name: Configure Functions plugin
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://xyzcompany.supabase.co",
supabaseKey = "public-anon-key"
) {
@@ -246,7 +246,7 @@ functions:
name: Configure GraphQL plugin
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://xyzcompany.supabase.co",
supabaseKey = "public-anon-key"
) {
@@ -264,7 +264,7 @@ functions:
`jwtToken` - Plugin specific JWT Token. Can be ignored when using the GoTrue plugin. Default: `null`
- **You can access the created ApolloClient via `client.graphql.apolloClient`, which automatically adds the required headers depending on your session.**
+ **You can access the created ApolloClient via `supabase.graphql.apolloClient`, which automatically adds the required headers depending on your session.**
- id: select
title: 'Fetch data: select()'
@@ -279,21 +279,21 @@ functions:
isSpotlight: true
code: |
```kotlin
- val city = client.postgrest["cities"].select().decodeSingle<City>()
+ val city = supabase.postgrest["cities"].select().decodeSingle<City>()
```
- id: selecting-specific-columns
name: Selecting specific columns
description: You can select specific fields from your tables.
code: |
```kotlin
- val city = client.postgrest["cities"].select(columns = Columns.list("id, name")).decodeSingle<City>()
+ val city = supabase.postgrest["cities"].select(columns = Columns.list("id, name")).decodeSingle<City>()
```
- id: query-foreign-tables
name: Query foreign tables
description: If your database has foreign key relationships, you can query related tables too.
code: |
```kotlin
- val country = client.postgrest["countries"]
+ val country = supabase.postgrest["countries"]
.select(
columns = Columns.raw(
"""
@@ -323,7 +323,7 @@ functions:
(both in the users) table
code: |
```kotlin
- val message = client.postgrest["messages"]
+ val message = supabase.postgrest["messages"]
.select(columns = Columns.raw(
"""
content,
@@ -339,7 +339,7 @@ functions:
Allowed values for count option are [Count.EXACT](https://postgrest.org/en/stable/api.html#exact-count), [Count.PLANNED](https://postgrest.org/en/stable/api.html#planned-count) and [Count.ESTIMATED](https://postgrest.org/en/stable/api.html#estimated-count).
code: |
```kotlin
- val count = client.postgrest["countries"]
+ val count = supabase.postgrest["countries"]
.select(head = true, count = Count.EXACT)
.count()!!
```
@@ -353,7 +353,7 @@ functions:
[PostgREST docs](http://postgrest.org/en/v7.0.0/api.html#json-columns) for more details.
code: |
```kotlin
- val user = client.postgrest["users"]
+ val user = supabase.postgrest["users"]
.select(columns = Columns.raw(
"""
id, name
@@ -377,7 +377,7 @@ functions:
code: |
```kotlin
val city = City(name = "The Shire", countryId = 554)
- client.postgrest["cities"].insert(city, returning = Returning.MINIMAL) //returning defaults to Returning.REPRESENTATION
+ supabase.postgrest["cities"].insert(city, returning = Returning.MINIMAL) //returning defaults to Returning.REPRESENTATION
```
- id: bulk-create
name: Bulk create
@@ -388,7 +388,7 @@ functions:
```kotlin
val theShire = City(name = "The Shire", countryId = 554)
val rohan = City(name = "Rohan", countryId = 554)
- client.postgrest["cities"].insert(listOf(theShire, rohan), returning = Returning.MINIMAL) //returning defaults to Returning.REPRESENTATION
+ supabase.postgrest["cities"].insert(listOf(theShire, rohan), returning = Returning.MINIMAL) //returning defaults to Returning.REPRESENTATION
```
- id: fetch-inserted-data
name: Fetch inserted record
@@ -396,7 +396,7 @@ functions:
```kotlin
val theShire = City(name = "The Shire", countryId = 554)
val rohan = City(name = "Rohan", countryId = 554)
- val result = client.postgrest["cities"].insert(listOf(theShire, rohan)).decodeList<City>()
+ val result = supabase.postgrest["cities"].insert(listOf(theShire, rohan)).decodeList<City>()
```
- id: update
@@ -410,7 +410,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["countries"].update(
+ supabase.postgrest["countries"].update(
{
Country::name setTo "Australia"
//or
@@ -426,7 +426,7 @@ functions:
name: Update a record and return it
code: |
```kotlin
- val newCountry = client.postgrest["countries"].update(
+ val newCountry = supabase.postgrest["countries"].update(
{
Country::name setTo "Australia"
//or
@@ -473,7 +473,7 @@ functions:
code: |
```kotlin
val address = Address(street = "Melrose Place", postcode = 90210)
- client.postgrest["users"].update(
+ supabase.postgrest["users"].update(
{
User::address setTo address
}
@@ -499,7 +499,7 @@ functions:
code: |
```kotlin
val toUpsert = Message(id = 3, message = "foo", username = "supabot")
- client.postgrest["messages"].insert(toUpsert, upsert = true)
+ supabase.postgrest["messages"].insert(toUpsert, upsert = true)
```
- id: upserting-into-tables-with-constraints
name: Upserting into tables with constraints
@@ -511,7 +511,7 @@ functions:
code: |
```kotlin
let toUpsert = User(username = "supabot")
- client.postgrest["users"].insert(toUpsert, upsert = true, onConflict = "username")
+ supabase.postgrest["users"].insert(toUpsert, upsert = true, onConflict = "username")
```
- id: upsert-return-row-count
name: Return the exact number of rows
@@ -519,7 +519,7 @@ functions:
code: |
```kotlin
let toUpsert = User(username = "supabot")
- val count = client.postgrest["users"].insert(toUpsert, upsert = true, onConflict = "username", count = Count.EXACT).count()
+ val count = supabase.postgrest["users"].insert(toUpsert, upsert = true, onConflict = "username", count = Count.EXACT).count()
```
- id: delete
@@ -538,7 +538,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::id eq 666
//or
eq("id", 666)
@@ -548,7 +548,7 @@ functions:
name: Fetch deleted records
code: |
```kotlin
- val deletedCity = client.postgrest["cities"].delete {
+ val deletedCity = supabase.postgrest["cities"].delete {
City::id eq 666
//or
eq("id", 666)
@@ -570,14 +570,14 @@ functions:
description: This is an example invoking a stored procedure.
code: |
```kotlin
- client.postgrest.rpc("hello_world")
+ supabase.postgrest.rpc("hello_world")
```
- id: with-parameters
name: With Parameters
code: |
```kotlin
val rpcParams = City(name = "The Shire")
- client.postgrest.rpc("echo_city", rpcParams)
+ supabase.postgrest.rpc("echo_city", rpcParams)
```
- id: using-filters
title: Using Filters
@@ -609,7 +609,7 @@ functions:
`delete()`, and `rpc()`
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name", "country_id")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name", "country_id")) {
City::name eq "The Shire"
//or
eq("name", "The Shire")
@@ -622,7 +622,7 @@ functions:
`delete()`, and `rpc()`
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name, country_id")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name, country_id")) {
and { //when both are true
City::population gt 40000
City::population lt 700000
@@ -671,7 +671,7 @@ functions:
```
code: |
```kotlin
- client.postgrest["users"].select {
+ supabase.postgrest["users"].select {
eq("address->postcode", 90210)
}
```
@@ -679,7 +679,7 @@ functions:
name: Filter Foreign Tables
code: |
```kotlin
- client.postgrest["countries"].select(
+ supabase.postgrest["countries"].select(
columns = Columns.raw("""
name,
cities!inner (
@@ -741,7 +741,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["countries"].select(columns = Columns.list("name")) {
+ supabase.postgrest["countries"].select(columns = Columns.list("name")) {
or {
Country::id eq 2
Country::name eq "Algeria"
@@ -755,7 +755,7 @@ functions:
name: Use `or` with `and`
code: |
```kotlin
- client.postgrest["countries"].select(columns = Columns.list("name")) {
+ supabase.postgrest["countries"].select(columns = Columns.list("name")) {
or {
Country::id gt 3
and {
@@ -778,7 +778,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["countries"].select {
+ supabase.postgrest["countries"].select {
filterNot("name", FilterOperation.IS, "")
}
```
@@ -793,7 +793,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name", "country_id")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name", "country_id")) {
City::name eq "The Shire"
//or
eq("name", "The Shire")
@@ -804,7 +804,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::name eq "San Francisco"
//or
eq("name", "San Francisco")
@@ -814,7 +814,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::name eq "Mordor"
//or
eq("name", "Mordor")
@@ -824,7 +824,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("function") {
+ supabase.postgrest.rpc("function") {
City::name eq "Mordor"
//or
eq("name", "Mordor")
@@ -841,7 +841,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name", "country_id")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name", "country_id")) {
City::name neq "The Shire"
//or
neq("name", "The Shire")
@@ -852,7 +852,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::name neq "The Shire"
//or
neq("name", "The Shire")
@@ -862,7 +862,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::name neq "The Shire"
//or
neq("name", "The Shire")
@@ -872,7 +872,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.rpc("echo_all_cities") {
+ supabase.rpc("echo_all_cities") {
neq("address->postcode", 90210)
}
```
@@ -887,7 +887,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::countryId gt 300
//or
gt("country_id", 300)
@@ -898,7 +898,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::countryId gt 300
//or
gt("country_id", 300)
@@ -908,7 +908,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::countryId gt 300
//or
gt("country_id", 300)
@@ -918,7 +918,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::countryId gt 250
//or
gt("country_id", 300)
@@ -935,7 +935,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::countryId gte 300
//or
gte("country_id", 300)
@@ -946,7 +946,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::countryId gte 300
//or
gte("country_id", 300)
@@ -956,7 +956,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::countryId gte 300
//or
gte("country_id", 300)
@@ -966,7 +966,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::countryId gte 250
//or
gte("country_id", 300)
@@ -983,7 +983,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::countryId lt 300
//or
lt("country_id", 300)
@@ -994,7 +994,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::countryId lt 300
//or
lt("country_id", 300)
@@ -1004,7 +1004,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::countryId lt 300
//or
lt("country_id", 300)
@@ -1014,7 +1014,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::countryId lt 250
//or
lt("country_id", 300)
@@ -1031,7 +1031,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::countryId lte 300
//or
lte("country_id", 300)
@@ -1042,7 +1042,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::countryId lte 300
//or
lte("country_id", 300)
@@ -1052,7 +1052,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::countryId lte 300
//or
lte("country_id", 300)
@@ -1062,7 +1062,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::countryId lte 250
//or
lte("country_id", 300)
@@ -1079,7 +1079,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::name like "%la%"
//or
like("name", "%la%")
@@ -1090,7 +1090,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::name like "%la%"
//or
like("name", "%la%")
@@ -1100,7 +1100,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::name like "%la%"
//or
like("name", "%la%")
@@ -1110,7 +1110,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::name like "%la%"
//or
like("name", "%la%")
@@ -1127,7 +1127,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::name ilike "%la%"
//or
ilike("name", "%la%")
@@ -1138,7 +1138,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::name ilike "%la%"
//or
ilike("name", "%la%")
@@ -1148,7 +1148,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::name ilike "%la%"
//or
ilike("name", "%la%")
@@ -1158,7 +1158,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::name ilike "%la%"
//or
ilike("name", "%la%")
@@ -1177,7 +1177,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::name isExact null
//or
exact("name", null)
@@ -1188,7 +1188,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::name isExact null
//or
exact("name", null)
@@ -1198,7 +1198,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::name isExact null
//or
exact("name", null)
@@ -1208,7 +1208,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::name isExact null
//or
exact("name", null)
@@ -1225,7 +1225,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::name isIn listOf("Rio de Janeiro", "San Francisco")
//or
isIn("name", listOf("Rio de Janeiro", "San Francisco"))
@@ -1236,7 +1236,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::name isIn listOf("Rio de Janeiro", "San Francisco")
//or
isIn("name", listOf("Rio de Janeiro", "San Francisco"))
@@ -1246,7 +1246,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::name isIn listOf("Rio de Janeiro", "San Francisco")
//or
isIn("name", listOf("Rio de Janeiro", "San Francisco"))
@@ -1256,7 +1256,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::name isIn listOf("Rio de Janeiro", "San Francisco")
//or
isIn("name", listOf("Rio de Janeiro", "San Francisco"))
@@ -1271,7 +1271,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["cities"].select(columns = Columns.list("name")) {
+ supabase.postgrest["cities"].select(columns = Columns.list("name")) {
City::mainExports contains listOf("oil")
//or
contains("main_exports", listOf("oil"))
@@ -1282,7 +1282,7 @@ functions:
code: |
```kotlin
val toUpdate = City(name = "Mordor")
- client.postgrest["cities"].update(toUpdate) {
+ supabase.postgrest["cities"].update(toUpdate) {
City::mainExports contains listOf("oil")
//or
contains("main_exports", listOf("oil"))
@@ -1292,7 +1292,7 @@ functions:
name: With `delete()`
code: |
```kotlin
- client.postgrest["cities"].delete {
+ supabase.postgrest["cities"].delete {
City::mainExports contains listOf("oil")
//or
contains("main_exports", listOf("oil"))
@@ -1302,7 +1302,7 @@ functions:
name: With `rpc()`
code: |
```kotlin
- client.postgrest.rpc("echo_all_cities") {
+ supabase.postgrest.rpc("echo_all_cities") {
City::mainExports contains listOf("oil")
//or
contains("main_exports", listOf("oil"))
@@ -1319,7 +1319,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["reservations"].select {
+ supabase.postgrest["reservations"].select {
Reservation::during rangeLt ("2000-01-02 08:30" to "2000-01-02 09:30")
//or
rangeLt("during", "2000-01-02 08:30" to "2000-01-02 09:30")
@@ -1373,7 +1373,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["reservations"].select {
+ supabase.postgrest["reservations"].select {
Reservation::during rangeGt ("2000-01-02 08:30" to "2000-01-02 09:30")
//or
rangeGt("during", "2000-01-02 08:30" to "2000-01-02 09:30")
@@ -1426,7 +1426,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["reservations"].select {
+ supabase.postgrest["reservations"].select {
Reservation::during rangeGte ("2000-01-02 08:30" to "2000-01-02 09:30")
//or
rangeGte("during", "2000-01-02 08:30" to "2000-01-02 09:30")
@@ -1481,7 +1481,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["reservations"].select {
+ supabase.postgrest["reservations"].select {
Reservation::during rangeLte ("2000-01-02 08:30" to "2000-01-02 09:30")
//or
rangeLte("during", "2000-01-02 08:30" to "2000-01-02 09:30")
@@ -1535,7 +1535,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.postgrest["reservations"].select {
+ supabase.postgrest["reservations"].select {
Reservation::during adjacent ("2000-01-02 08:30" to "2000-01-02 09:30")
//or
adjacent("during", "2000-01-02 08:30" to "2000-01-02 09:30")
@@ -1585,7 +1585,7 @@ functions:
name: On array columns
code: |
```kotlin
- client.postgrest["issues"].select(columns = Columns.list("title")) {
+ supabase.postgrest["issues"].select(columns = Columns.list("title")) {
Issue::tags overlaps listOf("is:closed", "severity:high")
//or
overlaps("tags", listOf("is:closed", "severity:high"))
@@ -1625,7 +1625,7 @@ functions:
name: On range columns
code: |
```kotlin
- client.postgrest["issues"].select(columns = Columns.list("title")) {
+ supabase.postgrest["issues"].select(columns = Columns.list("title")) {
Issue::tags overlaps listOf("is:closed", "severity:high")
//or
overlaps("tags", listOf("is:closed", "severity:high"))
@@ -1679,7 +1679,7 @@ functions:
name: Text search
code: |
```kotlin
- client.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
+ supabase.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
textSearch(column = "catchphrase", query = "'fat' & 'cat'", config = "english", type = TextSearchType.YOUR_TYPE)
}
```
@@ -1688,7 +1688,7 @@ functions:
description: Uses PostgreSQL's `plainto_tsquery` function.
code: |
```kotlin
- client.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
+ supabase.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
textSearch(column = "catchphrase", query = "'fat' & 'cat'", config = "english", type = TextSearchType.PLAINTO)
}
```
@@ -1697,7 +1697,7 @@ functions:
description: Uses PostgreSQL's `phraseto_tsquery` function.
code: |
```kotlin
- client.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
+ supabase.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
textSearch(column = "catchphrase", query = "'fat' & 'cat'", config = "english", type = TextSearchType.PHRASETO)
}
```
@@ -1715,7 +1715,7 @@ functions:
code: |
```kotlin
- client.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
+ supabase.postgrest["quotes"].select(columns = Columns.list("catchphrase")) {
textSearch(column = "catchphrase", query = "'fat' & 'cat'", config = "english", type = TextSearchType.WEBSEARCH)
}
```
@@ -1730,7 +1730,7 @@ functions:
name: With `select()`
code: |
```kotlin
- client.postgrest["countries"].select {
+ supabase.postgrest["countries"].select {
filter(column = "name", operator = FilterOperator.IN, value = "('Algeria', 'Japan')")
}
```
@@ -1766,7 +1766,7 @@ functions:
name: On a foreign table
code: |
```kotlin
- client.postgrest["countries"].select(
+ supabase.postgrest["countries"].select(
columns = Columns.raw("""
name,
cities!inner (
@@ -1828,7 +1828,7 @@ functions:
name: With `select()`
code: |
```kotlin
- client.postgrest["countries"].select(columns = Columns.list("id", "name")) {
+ supabase.postgrest["countries"].select(columns = Columns.list("id", "name")) {
order(column = "id", order = Order.ASCENDING)
}
```
@@ -1872,7 +1872,7 @@ functions:
name: On a foreign table
code: |
```kotlin
- client.postgrest["countries"].select(
+ supabase.postgrest["countries"].select(
columns = Columns.raw(
"""
name,
@@ -1947,7 +1947,7 @@ functions:
name: With `select()`
code: |
```kotlin
- client.postgrest["countries"].select {
+ supabase.postgrest["countries"].select {
limit(count = 20)
}
```
@@ -1982,7 +1982,7 @@ functions:
name: On a foreign table
code: |
```kotlin
- client.postgrest["countries"].select(
+ supabase.postgrest["countries"].select(
columns = Columns.raw(
"""
name,
@@ -2044,7 +2044,7 @@ functions:
name: With `select()`
code: |
```kotlin
- client.postgrest["countries"].select {
+ supabase.postgrest["countries"].select {
range(1L..5L)
}
```
@@ -2088,8 +2088,8 @@ functions:
isSpotlight: true
code: |
```kotlin
- val client = createSupabaseClient(supabaseURL = "https://xyzcompany.supabase.co'", supabaseKey = "public-anon-key") { ... }
- val gotrue = client.gotrue
+ val supabase = createSupabaseClient(supabaseURL = "https://xyzcompany.supabase.co'", supabaseKey = "public-anon-key") { ... }
+ val gotrue = supabase.gotrue
```
- id: sign-up
title: 'signUp()'
@@ -2111,7 +2111,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val user = client.gotrue.signUpWith(Email) {
+ val user = supabase.gotrue.signUpWith(Email) {
password = "example-password"
}
@@ -2121,7 +2121,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val user = client.gotrue.signUpWith(Phone) {
+ val user = supabase.gotrue.signUpWith(Phone) {
phoneNumber = "+4912345679"
password = "example-password"
}
@@ -2131,7 +2131,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- val user = client.gotrue.signUpWith(Email) {
+ val user = supabase.gotrue.signUpWith(Email) {
password = "example-password"
data = buildJsonObject {
@@ -2146,7 +2146,7 @@ functions:
- See [redirect URLs and wildcards](/docs/guides/auth/overview#redirect-urls-and-wildcards) to add additional redirect URLs to your project.
code: |
```kotlin
- val user = client.gotrue.signUpWith(Email, redirectUrl = "https://example.com") {
+ val user = supabase.gotrue.signUpWith(Email, redirectUrl = "https://example.com") {
password = "example-password"
}
@@ -2163,7 +2163,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.loginWith(Email) {
+ supabase.gotrue.loginWith(Email) {
password = "example-password"
}
@@ -2173,7 +2173,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- client.gotrue.loginWith(Phone) {
+ supabase.gotrue.loginWith(Phone) {
phoneNumber = "+4912345679"
password = "example-password"
}
@@ -2183,7 +2183,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- client.gotrue.loginWith(IDToken) {
+ supabase.gotrue.loginWith(IDToken) {
idToken = "token"
provider = Google //Also supported: Apple, Azure and Facebook
//optional:
@@ -2215,7 +2215,7 @@ functions:
description: The user will be sent an email which contains either a magiclink or a OTP or both. By default, a given user can only request a OTP once every 60 seconds.
code: |
```kotlin
- client.gotrue.sendOtpTo(Email) {
+ supabase.gotrue.sendOtpTo(Email) {
}
```
@@ -2225,7 +2225,7 @@ functions:
description: The user will be sent a SMS which contains a OTP. By default, a given user can only request a OTP once every 60 seconds.
code: |
```kotlin
- client.gotrue.sendOtpTo(Phone) {
+ supabase.gotrue.sendOtpTo(Phone) {
phoneNumber = "+4912345679"
}
```
@@ -2242,14 +2242,14 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.loginWith(Github)
+ supabase.gotrue.loginWith(Github)
```
- id: sign-in-using-a-third-party-provider with scopes
name: Sign in using a third-party provider with scopes
isSpotlight: true
code: |
```kotlin
- client.gotrue.loginWith(Github) {
+ supabase.gotrue.loginWith(Github) {
scopes.add("email")
}
```
@@ -2265,7 +2265,7 @@ functions:
- To see how you can use a custom in-app browser on Android, check our [demo](https://github.com/supabase-community/supabase-kt/tree/development/demos/android-login) on GitHub.
code: |
```kotlin
- val url = client.gotrue.oAuthUrl(Github, redirectUrl = "https://example.com")
+ val url = supabase.gotrue.oAuthUrl(Github, redirectUrl = "https://example.com")
```
- id: sign-in-with-scopes
name: Create a custom url with scopes
@@ -2275,7 +2275,7 @@ functions:
You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider. The list of scopes will be documented by the third-party provider you are using and specifying scopes will enable you to use the OAuth provider token to call additional APIs supported by the third-party provider to get more information.
code: |
```kotlin
- val url = client.gotrue.oAuthUrl(Github, redirectUrl = "https://example.com") {
+ val url = supabase.gotrue.oAuthUrl(Github, redirectUrl = "https://example.com") {
scopes.add("email")
}
```
@@ -2299,7 +2299,7 @@ functions:
// You can extract the user's email domain and use it to trigger the
// authentication flow with the correct identity provider.
- client.gotrue.loginWith(SSO.withDomain("company.com"))
+ supabase.gotrue.loginWith(SSO.withDomain("company.com"))
//the url was opened automatically, if you don't want that, provide a custom redirect url
```
@@ -2311,7 +2311,7 @@ functions:
// Useful when you need to map a user's sign in request according
// to different rules that can't use email domains.
- client.gotrue.loginWith(SSO.withProvider("21648a9d-8d5a-4555-a9d1-d6375dc14e92"))
+ supabase.gotrue.loginWith(SSO.withProvider("21648a9d-8d5a-4555-a9d1-d6375dc14e92"))
//the url was opened automatically, if you don't want that, provide a custom redirect url
```
@@ -2327,21 +2327,21 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.logout()
+ supabase.gotrue.logout()
```
- id: sign-out-all-sessions
name: Sign out all sessions
isSpotlight: true
code: |
```kotlin
- client.gotrue.logout(LogoutScope.GLOBAL)
+ supabase.gotrue.logout(LogoutScope.GLOBAL)
```
- id: sign-out-others
name: Sign out all sessions except the current
isSpotlight: true
code: |
```kotlin
- client.gotrue.logout(LogoutScope.OTHERS)
+ supabase.gotrue.logout(LogoutScope.OTHERS)
```
- id: verify-otp
title: 'Verify OTPs'
@@ -2354,7 +2354,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.verifyEmailOtp(type = OtpType.Email.INVITE, email = "[email protected]", token = "token")
+ supabase.gotrue.verifyEmailOtp(type = OtpType.Email.INVITE, email = "[email protected]", token = "token")
```
description: |
Available types are:
@@ -2368,7 +2368,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- client.gotrue.verifyPhoneOtp(type = OtpType.Phone.SMS, phoneNumber = "+491234567", token = "token")
+ supabase.gotrue.verifyPhoneOtp(type = OtpType.Phone.SMS, phoneNumber = "+491234567", token = "token")
```
description: |
Available types are:
@@ -2387,7 +2387,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.reauthenticate()
+ supabase.gotrue.reauthenticate()
```
- id: resend-email-or-phone-otps
title: 'resend()'
@@ -2404,28 +2404,28 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.resendEmail(OtpType.Email.SIGNUP, "[email protected]")
+ supabase.gotrue.resendEmail(OtpType.Email.SIGNUP, "[email protected]")
```
- id: resend-phone-signup-confirmation
name: Resend a phone signup confirmation
description: Resends the phone signup confirmation email to the user
code: |
```kotlin
- client.gotrue.resendPhone(OtpType.Phone.SMS, "1234567890")
+ supabase.gotrue.resendPhone(OtpType.Phone.SMS, "1234567890")
```
- id: resend-email-change-email
name: Resend email change email
description: Resends the email change email to the user
code: |
```kotlin
- client.gotrue.resendEmail(OtpType.Email.EMAIL_CHANGE, "[email protected]")
+ supabase.gotrue.resendEmail(OtpType.Email.EMAIL_CHANGE, "[email protected]")
```
- id: resend-phone-change
name: Resend phone change OTP
description: Resends the phone change OTP to the user
code: |
```kotlin
- client.gotrue.resendPhone(OtpType.Phone.PHONE_CHANGE, "1234567890")
+ supabase.gotrue.resendPhone(OtpType.Phone.PHONE_CHANGE, "1234567890")
```
- id: get-session
title: 'Get current session'
@@ -2438,7 +2438,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val session = client.gotrue.currentSessionOrNull()
+ val session = supabase.gotrue.currentSessionOrNull()
```
- id: get-user
title: 'getUser()'
@@ -2453,7 +2453,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val user = client.gotrue.retrieveUserForCurrentSession(updateSession = true)
+ val user = supabase.gotrue.retrieveUserForCurrentSession(updateSession = true)
```
description: |
`updateSession` updates the local session with the new user
@@ -2462,7 +2462,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val user = client.gotrue.retrieveUser("JWT")
+ val user = supabase.gotrue.retrieveUser("JWT")
```
- id: update-user
title: 'modifyUser()'
@@ -2479,7 +2479,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- val user = client.gotrue.modifyUser {
+ val user = supabase.gotrue.modifyUser {
}
```
@@ -2488,7 +2488,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- val user = client.gotrue.modifyUser {
+ val user = supabase.gotrue.modifyUser {
password = "secretPassword"
}
```
@@ -2497,7 +2497,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val user = client.gotrue.modifyUser {
+ val user = supabase.gotrue.modifyUser {
data {
put("name", "John")
}
@@ -2518,7 +2518,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.importSession(UserSession(accessToken = "token", refreshToken = "refresh", expiresIn = 2000, tokenType = "Bearer", user = null))
+ supabase.gotrue.importSession(UserSession(accessToken = "token", refreshToken = "refresh", expiresIn = 2000, tokenType = "Bearer", user = null))
```
- id: refresh-session
title: 'refreshSession()'
@@ -2533,14 +2533,14 @@ functions:
isSpotlight: true
code: |
```kotlin
- val session = client.gotrue.refreshCurrentSession()
+ val session = supabase.gotrue.refreshCurrentSession()
```
- id: refresh-session-using-the-current-session
name: Refresh session using the refresh token
isSpotlight: true
code: |
```kotlin
- val session = client.gotrue.refreshSession(refreshToken = "refreshToken")
+ val session = supabase.gotrue.refreshSession(refreshToken = "refreshToken")
```
- id: on-auth-state-change
title: 'sessionStatus'
@@ -2553,7 +2553,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.sessionStatus.collect {
+ supabase.gotrue.sessionStatus.collect {
when(it) {
is SessionStatus.Authenticated -> println(it.session.user)
SessionStatus.LoadingFromStorage -> println("Loading from storage")
@@ -2578,7 +2578,7 @@ functions:
- The user gets redirected back to your app, assuming you setup [OTP handling](/docs/reference/kotlin/initializing)
- After the user has been redirected successfully, prompt them for a new password and call `modifyUser()`:
```kotlin
- client.gotrue.modifyUser {
+ supabase.gotrue.modifyUser {
password = "1234567"
}
```
@@ -2588,7 +2588,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.sendRecoveryEmail(email = "[email protected]")
+ supabase.gotrue.sendRecoveryEmail(email = "[email protected]")
```
- id: exchange-code-for-session
title: 'exchangeCodeForSession()'
@@ -2601,12 +2601,12 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.exchangeCodeForSession("34e770dd-9ff9-416c-87fa-43b31d7ef225")
+ supabase.gotrue.exchangeCodeForSession("34e770dd-9ff9-416c-87fa-43b31d7ef225")
```
- id: auth-mfa-api
title: 'Overview'
notes: |
- This section contains methods commonly used for Multi-Factor Authentication (MFA) and are invoked behind the `client.gotrue.mfa` namespace.
+ This section contains methods commonly used for Multi-Factor Authentication (MFA) and are invoked behind the `supabase.gotrue.mfa` namespace.
Currently, we only support time-based one-time password (TOTP) as the 2nd factor. We don't support recovery codes but we allow users to enroll more than 1 TOTP factor, with an upper limit of 10.
@@ -2626,7 +2626,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val factor = client.gotrue.mfa.enroll(factorType = FactorType.TOTP)
+ val factor = supabase.gotrue.mfa.enroll(factorType = FactorType.TOTP)
// Use the id to create a challenge.
// The challenge can be verified by entering the code generated from the authenticator app.
@@ -2639,14 +2639,14 @@ functions:
isSpotlight: true
code: |
```kotlin
- val verifiedFactors = client.gotrue.mfa.verifiedFactors
+ val verifiedFactors = supabase.gotrue.mfa.verifiedFactors
```
- id: retrieve-verified-factors
name: Retrieve verified factors
isSpotlight: true
code: |
```kotlin
- val verifiedFactors = client.gotrue.mfa.retrieveFactorsForCurrentUser()
+ val verifiedFactors = supabase.gotrue.mfa.retrieveFactorsForCurrentUser()
```
- id: mfa-challenge
title: 'mfa.challenge()'
@@ -2661,7 +2661,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val challenge = client.gotrue.mfa.createChallenge(factorId = "34e770dd-9ff9-416c-87fa-43b31d7ef225")
+ val challenge = supabase.gotrue.mfa.createChallenge(factorId = "34e770dd-9ff9-416c-87fa-43b31d7ef225")
```
- id: mfa-verify
title: 'mfa.verify()'
@@ -2675,7 +2675,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.mfa.verifyChallenge(
+ supabase.gotrue.mfa.verifyChallenge(
factorId = "34e770dd-9ff9-416c-87fa-43b31d7ef225",
challengeId = "4034ae6f-a8ce-4fb5-8ee5-69a5863a7c15",
code = "123456",
@@ -2695,7 +2695,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.mfa.createChallengeAndVerify(
+ supabase.gotrue.mfa.createChallengeAndVerify(
factorId = "34e770dd-9ff9-416c-87fa-43b31d7ef225",
code = "123456",
saveSession = true // this is set to true by default, but you can set it to false if you want to handle the session yourself
@@ -2712,7 +2712,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.mfa.unenroll(factorId = "34e770dd-9ff9-416c-87fa-43b31d7ef225")
+ supabase.gotrue.mfa.unenroll(factorId = "34e770dd-9ff9-416c-87fa-43b31d7ef225")
```
- id: mfa-get-authenticator-assurance-level
title: 'mfa.getAuthenticatorAssuranceLevel()'
@@ -2727,30 +2727,30 @@ functions:
isSpotlight: true
code: |
```kotlin
- val (current, next) = client.gotrue.mfa.getAuthenticatorAssuranceLevel()
+ val (current, next) = supabase.gotrue.mfa.getAuthenticatorAssuranceLevel()
```
- id: aal-enabled
name: Check whether the user has at least one verified factor
isSpotlight: true
code: |
```kotlin
- val enabled = client.gotrue.mfa.isMfaEnabled
+ val enabled = supabase.gotrue.mfa.isMfaEnabled
//flow variant, automatically emitting new values on session changes
- val enabledFlow = client.gotrue.mfa.isMfaEnabledFlow
+ val enabledFlow = supabase.gotrue.mfa.isMfaEnabledFlow
```
- id: aal-enabled-for-current-session
name: Check whether the user is logged in using AAL2
isSpotlight: true
code: |
```kotlin
- val loggedInUsingMfa = client.gotrue.mfa.loggedInUsingMfa
+ val loggedInUsingMfa = supabase.gotrue.mfa.loggedInUsingMfa
//flow variant, automatically emitting new values on session changes
- val loggedInUsingMfaFlow = client.gotrue.mfa.loggedInUsingMfaFlow
+ val loggedInUsingMfaFlow = supabase.gotrue.mfa.loggedInUsingMfaFlow
```
- id: admin-api
title: 'Overview'
notes: |
- - Any method under the `client.gotrue.admin` namespace requires a `service_role` key.
+ - Any method under the `supabase.gotrue.admin` namespace requires a `service_role` key.
- These methods are considered admin methods and should be called on a trusted server. Never expose your `service_role` key in the browser.
examples:
- id: create-auth-admin-client
@@ -2758,7 +2758,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val client = createSupabaseClient(
+ val supabase = createSupabaseClient(
supabaseUrl = "https://id.supabase.co",
supabaseKey = "supabaseKey"
) {
@@ -2768,10 +2768,10 @@ functions:
}
// install other plugins (these will use the service role key)
}
- client.gotrue.importAuthToken("service_role")
+ supabase.gotrue.importAuthToken("service_role")
// Access auth admin api
- val adminGoTrueClient = client.gotrue.admin
+ val adminGoTrueClient = supabase.gotrue.admin
```
- id: get-user-by-id
@@ -2786,7 +2786,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val user = client.gotrue.admin.retrieveUserById(uid = "f2a0b0a0-6b1a-4b7a-8f1a-4b7a6b1a8f1a")
+ val user = supabase.gotrue.admin.retrieveUserById(uid = "f2a0b0a0-6b1a-4b7a-8f1a-4b7a6b1a8f1a")
```
- id: list-users
@@ -2801,14 +2801,14 @@ functions:
isSpotlight: true
code: |
```kotlin
- val users = client.gotrue.admin.retrieveUsers()
+ val users = supabase.gotrue.admin.retrieveUsers()
```
- id: get-paginated-list-of-users
name: Paginated list of users
isSpotlight: false
code: |
```kotlin
- val users = client.gotrue.admin.retrieveUsers(
+ val users = supabase.gotrue.admin.retrieveUsers(
page = 1,
perPage = 100
)
@@ -2825,7 +2825,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val userWithEmail = client.gotrue.admin.createUserWithEmail {
+ val userWithEmail = supabase.gotrue.admin.createUserWithEmail {
password = "secretpassword"
userMetadata {
@@ -2838,7 +2838,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val userWithPhone = client.gotrue.admin.createUserWithPhone {
+ val userWithPhone = supabase.gotrue.admin.createUserWithPhone {
phoneNumber = "+49123456789"
password = "secretpassword"
userMetadata {
@@ -2850,7 +2850,7 @@ functions:
name: Auto-confirm the user's email
code: |
```kotlin
- val userWithEmail = client.gotrue.admin.createUserWithEmail {
+ val userWithEmail = supabase.gotrue.admin.createUserWithEmail {
password = "secretpassword"
autoConfirm = true
@@ -2860,7 +2860,7 @@ functions:
name: Auto-confirm the user's phone number
code: |
```kotlin
- val userWithPhone = client.gotrue.admin.createUserWithPhone {
+ val userWithPhone = supabase.gotrue.admin.createUserWithPhone {
phoneNumber = "+49123456789"
password = "secretpassword"
autoConfirm = true
@@ -2878,7 +2878,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.admin.deleteUser(uid = "uid")
+ supabase.gotrue.admin.deleteUser(uid = "uid")
```
- id: invite-user-by-email
@@ -2892,7 +2892,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.admin.inviteUserByEmail(
+ supabase.gotrue.admin.inviteUserByEmail(
email = "[email protected]",
//optional:
redirectTo = "https://example.com/redirect",
@@ -2913,7 +2913,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val (url, user) = client.gotrue.admin.generateLinkFor(LinkType.Signup) {
+ val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.Signup) {
password = "secretpassword"
}
@@ -2923,7 +2923,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- val (url, user) = client.gotrue.admin.generateLinkFor(LinkType.Invite) {
+ val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.Invite) {
}
```
@@ -2932,7 +2932,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- val (url, user) = client.gotrue.admin.generateLinkFor(LinkType.MagicLink) {
+ val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.MagicLink) {
}
```
@@ -2941,7 +2941,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- val (url, user) = client.gotrue.admin.generateLinkFor(LinkType.Recovery) {
+ val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.Recovery) {
}
```
@@ -2951,13 +2951,13 @@ functions:
code: |
```kotlin
// generate an email change link to be sent to the current email address
- val (url, user) = client.gotrue.admin.generateLinkFor(LinkType.EmailChangeCurrent) {
+ val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.EmailChangeCurrent) {
newEmail = "[email protected]"
}
// generate an email change link to be sent to the new email address
- val (url, user) = client.gotrue.admin.generateLinkFor(LinkType.EmailChangeNew) {
+ val (url, user) = supabase.gotrue.admin.generateLinkFor(LinkType.EmailChangeNew) {
newEmail = "[email protected]"
}
@@ -2974,7 +2974,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- client.gotrue.admin.updateUserById(uid = "id") {
+ supabase.gotrue.admin.updateUserById(uid = "id") {
}
```
@@ -2983,7 +2983,7 @@ functions:
isSpotlight: false
code: |
```js
- client.gotrue.admin.updateUserById(uid = "id") {
+ supabase.gotrue.admin.updateUserById(uid = "id") {
password = "password"
}
```
@@ -2992,7 +2992,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.admin.updateUserById(uid = "id") {
+ supabase.gotrue.admin.updateUserById(uid = "id") {
userMetadata = buildJsonObject {
put("key", "value")
}
@@ -3003,7 +3003,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- client.gotrue.admin.updateUserById(uid = "id") {
+ supabase.gotrue.admin.updateUserById(uid = "id") {
appMetadata = buildJsonObject {
put("key", "value")
}
@@ -3014,7 +3014,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- client.gotrue.admin.updateUserById(uid = "id") {
+ supabase.gotrue.admin.updateUserById(uid = "id") {
emailConfirm = true
}
```
@@ -3023,7 +3023,7 @@ functions:
isSpotlight: false
code: |
```kotlin
- client.gotrue.admin.updateUserById(uid = "id") {
+ supabase.gotrue.admin.updateUserById(uid = "id") {
phoneConfirm = true
}
```
@@ -3038,7 +3038,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- const factors = client.gotrue.admin.retrieveFactors(uid = "id")
+ const factors = supabase.gotrue.admin.retrieveFactors(uid = "id")
```
- id: mfa-delete-factor
title: 'mfa.deleteFactor()'
@@ -3051,7 +3051,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.gotrue.admin.deleteFactor(uid = "id", factorId = "factor_id")
+ supabase.gotrue.admin.deleteFactor(uid = "id", factorId = "factor_id")
```
- id: invoke
title: 'invoke()'
@@ -3066,14 +3066,14 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.functions.invoke("function_name")
+ supabase.functions.invoke("function_name")
```
- id: basic-invocation-with-body
name: Basic invocation with body
isSpotlight: true
code: |
```kotlin
- client.functions.invoke(
+ supabase.functions.invoke(
function = "function_name",
body = buildJsonObject {
put("foo", "bar")
@@ -3088,7 +3088,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val function = client.functions.buildEdgeFunction(
+ val function = supabase.functions.buildEdgeFunction(
function = "function",
headers = Headers.build {
/*Default headers*/
@@ -3120,7 +3120,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.realtime.connect()
+ supabase.realtime.connect()
```
- id: liste-to-broadcasts
name: Listen to broadcasts
@@ -3129,7 +3129,7 @@ functions:
@Serializable
data class Message(val content: String, val sender: String)
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
@@ -3140,7 +3140,7 @@ functions:
println(it)
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join(blockUntilJoined = true)
channel.broadcast(event = "message", Message("I joined!", "John"))
@@ -3153,7 +3153,7 @@ functions:
data class PresenceState(val username: String)
val connectedUsers = mutableSetOf<PresenceState>()
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
@@ -3165,7 +3165,7 @@ functions:
connectedUsers -= it.decodeLeavesAs<PresenceState>()
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join(blockUntilJoined = true)
//send own state
channel.track(PresenceState(username = "John"))
@@ -3173,7 +3173,7 @@ functions:
name: Listen to all database changes
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
val changeFlow = channel.postgresChangeFlow<PostgresAction>(schema = "public")
@@ -3188,14 +3188,14 @@ functions:
}
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join()
```
- id: listen-to-a-specific-table
name: Listen to a specific table
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
val changeFlow = channel.postgresChangeFlow<PostgresAction>(schema = "public") {
@@ -3212,14 +3212,14 @@ functions:
}
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join()
```
- id: listen-to-inserts
name: Listen to inserts
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
val changeFlow = channel.postgresChangeFlow<PostgresAction.Insert>(schema = "public") {
@@ -3231,7 +3231,7 @@ functions:
println(it.record)
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join()
```
- id: listen-to-updates
@@ -3245,7 +3245,7 @@ functions:
```
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
val changeFlow = channel.postgresChangeFlow<PostgresAction.Update>(schema = "public") {
@@ -3258,7 +3258,7 @@ functions:
println(it.oldRecord)
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join()
```
- id: listen-to-deletes
@@ -3272,7 +3272,7 @@ functions:
```
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
val changeFlow = channel.postgresChangeFlow<PostgresAction.Delete>(schema = "public") {
@@ -3284,7 +3284,7 @@ functions:
println(it.oldRecord)
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join()
```
- id: listening-to-row-level-changes
@@ -3292,7 +3292,7 @@ functions:
description: You can listen to individual rows using the format `{table}:{col}=eq.{val}` - where `{col}` is the column name, and `{val}` is the value which you want to match.
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
val changeFlow = channel.postgresChangeFlow<PostgresAction.Delete>(schema = "public") {
@@ -3305,7 +3305,7 @@ functions:
println(it.oldRecord)
}
- client.realtime.connect()
+ supabase.realtime.connect()
channel.join()
```
@@ -3322,18 +3322,18 @@ functions:
isSpotlight: true
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
//...
- client.realtime.removeChannel(channel)
+ supabase.realtime.removeChannel(channel)
```
- id: unsubscribe-channel
name: Unsubscribe from a channel
isSpotlight: true
code: |
```kotlin
- val channel = client.realtime.createChannel("channelId") {
+ val channel = supabase.realtime.createChannel("channelId") {
//optional config
}
//...
@@ -3351,7 +3351,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.realtime.removeAllChannels()
+ supabase.realtime.removeAllChannels()
```
- id: get-channels
title: getChannels()
@@ -3364,7 +3364,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val channels = client.realtime.subscriptions.entries
+ val channels = supabase.realtime.subscriptions.entries
```
- id: list-buckets
title: listBuckets()
@@ -3380,7 +3380,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val buckets = client.storage.retrieveBuckets()
+ val buckets = supabase.storage.retrieveBuckets()
```
- id: get-bucket
@@ -3397,7 +3397,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage.retrieveBucketById(bucketId = "avatars")
+ val bucket = supabase.storage.retrieveBucketById(bucketId = "avatars")
```
- id: create-bucket
@@ -3414,7 +3414,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.storage.createBucket(name = "icons", id = "icons") {
+ supabase.storage.createBucket(name = "icons", id = "icons") {
public = true
fileSizeLimit = 5.megabytes
}
@@ -3433,7 +3433,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.storage.updateBucket("cards") {
+ supabase.storage.updateBucket("cards") {
public = false
fileSizeLimit = 20.megabytes
allowedMimeTypes(ContentType.Image.PNG, ContentType.Image.JPEG)
@@ -3454,7 +3454,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.storage.emptyBucket(bucketId = "icons")
+ supabase.storage.emptyBucket(bucketId = "icons")
```
- id: delete-bucket
title: deleteBucket()
@@ -3470,7 +3470,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.storage.deleteBucket(bucketId = "icons")
+ supabase.storage.deleteBucket(bucketId = "icons")
```
- id: from-upload
@@ -3488,7 +3488,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
bucket.upload("myIcon.png", byteArray, upsert = false)
//on JVM you can use java.io.File
bucket.upload("myIcon.png", file, upsert = false)
@@ -3498,7 +3498,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
bucket.uploadAsFlow("test.png", byteArrayOf()).collect {
when(it) {
is UploadStatus.Progress -> println("Progress: ${it.totalBytesSend.toFloat() / it.contentLength * 100}%")
@@ -3511,7 +3511,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
//JVM/Android:
val upload = bucket.resumable.createOrContinueUpload("icon.png", File("icon.png"))
//Other platforms:
@@ -3559,7 +3559,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
//only on JVM/Android:
bucket.resumable.continuePreviousFileUploads()
@@ -3592,7 +3592,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
bucket.update("myIcon.png", byteArray, upsert = false)
//on JVM you can use java.io.File
bucket.update("myIcon.png", file, upsert = false)
@@ -3612,7 +3612,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
bucket.move("icon1.png", "icon2.png")
```
- id: from-copy
@@ -3629,7 +3629,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.storage["test"].copy(from = "avatar.png", to = "avatar2.png")
+ supabase.storage["test"].copy(from = "avatar.png", to = "avatar2.png")
```
- id: from-create-signed-url
title: from.createSignedUrl()
@@ -3645,14 +3645,14 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
val url = bucket.createSignedUrl(path = "icon.png", expiresIn = 3.minutes)
```
- id: create-signed-url-with-transformation
name: Create Signed URL with transformation
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
val url = bucket.createSignedUrl(path = "icon.png", expiresIn = 3.minutes) {
size(100, 100)
fill()
@@ -3672,7 +3672,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val urls = client.storage["avatars"].createSignedUrls(20.minutes, "avata1.jpg", "avatar2.jpg")
+ val urls = supabase.storage["avatars"].createSignedUrls(20.minutes, "avata1.jpg", "avatar2.jpg")
```
- id: from-create-signed-upload-url
title: from.createSignedUploadUrl()
@@ -3688,7 +3688,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val url = client.storage["avatars"].createSignedUploadUrl("avatar.png")
+ val url = supabase.storage["avatars"].createSignedUploadUrl("avatar.png")
```
- id: from-upload-to-signed-url
title: from.uploadToSignedUrl()
@@ -3704,9 +3704,9 @@ functions:
isSpotlight: true
code: |
```kotlin
- client.storage["avatars"].uploadToSignedUrl(path = "avatar.jpg", token = "token-from-createSignedUploadUrl", data = bytes)
+ supabase.storage["avatars"].uploadToSignedUrl(path = "avatar.jpg", token = "token-from-createSignedUploadUrl", data = bytes)
//or on JVM:
- client.storage["avatars"].uploadToSignedUrl(path = "avatar.jpg", token = "token-from-createSignedUploadUrl", file = File("avatar.jpg"))
+ supabase.storage["avatars"].uploadToSignedUrl(path = "avatar.jpg", token = "token-from-createSignedUploadUrl", file = File("avatar.jpg"))
```
- id: from-get-public-url
title: from.getPublicUrl()
@@ -3723,14 +3723,14 @@ functions:
isSpotlight: true
code: |
```kotlin
- val url = client.storage["public-bucket"].publicUrl("folder/avatar1.png")
+ val url = supabase.storage["public-bucket"].publicUrl("folder/avatar1.png")
```
- id: transform-asset-in-public-bucket
name: Returns the URL for an asset in a public bucket with transformations
isSpotlight: true
code: |
```kotlin
- val url = client.storage["public-bucket"].publicRenderUrl("folder/avatar1.png") {
+ val url = supabase.storage["public-bucket"].publicRenderUrl("folder/avatar1.png") {
size(100, 100)
}
```
@@ -3749,7 +3749,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
val bytes = bucket.downloadAuthenticated("test.png")
//or on JVM:
bucket.downloadAuthenticatedTo("test.png", File("test.png"))
@@ -3759,7 +3759,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
val bytes = bucket.downloadPublic("test.png")
//or on JVM:
bucket.downloadPublicTo("test.png", File("test.png"))
@@ -3768,7 +3768,7 @@ functions:
name: Download file with transformation
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
val bytes = bucket.downloadPublic("test.png") {
size(100, 100)
fill()
@@ -3785,7 +3785,7 @@ functions:
name: Download file with progress
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
bucket.downloadAuthenticatedAsFlow("icon.png").collect {
when(it) {
is DownloadStatus.ByteData -> println("Downloaded ${it.data.size} bytes")
@@ -3816,7 +3816,7 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
bucket.delete("test.png", "test2.png")
```
@@ -3834,6 +3834,6 @@ functions:
isSpotlight: true
code: |
```kotlin
- val bucket = client.storage["avatars"]
+ val bucket = supabase.storage["avatars"]
val files = bucket.list()
```