Skip to content

Commit 3415459

Browse files
authored
docs: Kotlin documentation improvements (supabase#30676)
* Add note about the minimum Android SDK version and add missing Kotlin snippets * Prettier
1 parent f3c6e58 commit 3415459

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

apps/docs/content/guides/auth/auth-anonymous.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,10 @@ try await supabase.auth.updateUser(
148148
</TabPanel>
149149
<TabPanel id="kotlin" label="Kotlin">
150150

151-
You can use the [`modifyUser()`](/docs/reference/kotlin/auth-updateuser) method to link an email or phone identity to the anonymous user.
151+
You can use the [`updateUser()`](/docs/reference/kotlin/auth-updateuser) method to link an email or phone identity to the anonymous user.
152152

153153
```kotlin
154-
supabase.auth.modifyUser {
154+
supabase.auth.updateUser {
155155
156156
}
157157
```

apps/docs/content/guides/auth/debugging/error-codes.mdx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,15 @@ Errors originating from the server API classed as `AuthApiError` always have a `
5959

6060
</TabPanel>
6161
<TabPanel id="kotlin" label="Kotlin">
62-
All errors originating from the `supabase.auth` namespace of the JavaScript client library will be wrapped by the `AuthError` class.
62+
All exceptions originating from the `supabase.auth` namespace of the Kotlin client library will be a subclass of `RestException`.
6363

64-
Error objects are split in a few classes:
64+
Rest exceptions are split into a few classes:
6565

66-
- `AuthApiError` -- errors which originate from the Supabase Auth API.
67-
- Use `isAuthApiError` instead of `instanceof` checks to see if an error you caught is of this type.
68-
- `CustomAuthError` -- errors which generally originate from state in the client library.
69-
- Use the `name` property on the error to identify the class of error received.
66+
- `AuthRestException` -- exceptions which originate from the Supabase Auth API and have a `errorCode` property that can be used to identify the error returned by the server.
67+
- `AuthWeakPasswordException` -- an `AuthRestException` which indicates that the password is too weak.
68+
- `AuthSessionMissingException` -- an `AuthRestException` which indicates that the session is missing, if the user was logged out or deleted.
7069

71-
Errors originating from the server API classed as `AuthApiError` always have a `code` property that can be used to identify the error returned by the server. The `status` property is also present, encoding the HTTP status code received in the response.
70+
All instances and subclasses of a `AuthRestException` have a `errorCode` property that can be used to identify the error returned by the server.
7271

7372
</TabPanel>
7473

apps/docs/content/guides/auth/phone-login.mdx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,15 @@ try await supabase.auth.updateUser(
215215
)
216216
```
217217

218+
</TabPanel>
219+
<TabPanel id="kotlin" label="Kotlin">
220+
221+
```kotlin
222+
supabase.auth.updateUser {
223+
phone = "123456789"
224+
}
225+
```
226+
218227
</TabPanel>
219228
<TabPanel id="python" label="Python">
220229

apps/docs/docs/ref/kotlin/installing.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
3030

3131
Checkout the different READMEs for information about supported Kotlin targets.
3232

33+
*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).*
34+
3335
</RefSubLayout.Details>
3436
<RefSubLayout.Examples>
3537
<Tabs

0 commit comments

Comments
 (0)