docs: Kotlin documentation improvements (#30676)

* Add note about the minimum Android SDK version and add missing Kotlin snippets

* Prettier
This commit is contained in:
Jan Tennert authored and GitHub committed 2024-11-27 17:01:31 +00:00
1 parent f3c6e58755
commit 3415459031
4 files changed
+19 -9

No files matched your search

@@ -148,10 +148,10 @@ try await supabase.auth.updateUser(
</TabPanel>
<TabPanel id="kotlin" label="Kotlin">
You can use the [`modifyUser()`](/docs/reference/kotlin/auth-updateuser) method to link an email or phone identity to the anonymous user.
You can use the [`updateUser()`](/docs/reference/kotlin/auth-updateuser) method to link an email or phone identity to the anonymous user.
```kotlin
supabase.auth.modifyUser {
supabase.auth.updateUser {
email = "example@email.com"
}
```
@@ -59,16 +59,15 @@ Errors originating from the server API classed as `AuthApiError` always have a `
</TabPanel>
<TabPanel id="kotlin" label="Kotlin">
All errors originating from the `supabase.auth` namespace of the JavaScript client library will be wrapped by the `AuthError` class.
All exceptions originating from the `supabase.auth` namespace of the Kotlin client library will be a subclass of `RestException`.
Error objects are split in a few classes:
Rest exceptions are split into a few classes:
- `AuthApiError` -- errors which originate from the Supabase Auth API.
- Use `isAuthApiError` instead of `instanceof` checks to see if an error you caught is of this type.
- `CustomAuthError` -- errors which generally originate from state in the client library.
- Use the `name` property on the error to identify the class of error received.
- `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.
- `AuthWeakPasswordException` -- an `AuthRestException` which indicates that the password is too weak.
- `AuthSessionMissingException` -- an `AuthRestException` which indicates that the session is missing, if the user was logged out or deleted.
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.
All instances and subclasses of a `AuthRestException` have a `errorCode` property that can be used to identify the error returned by the server.
</TabPanel>
@@ -215,6 +215,15 @@ try await supabase.auth.updateUser(
)
```
</TabPanel>
<TabPanel id="kotlin" label="Kotlin">
```kotlin
supabase.auth.updateUser {
phone = "123456789"
}
```
</TabPanel>
<TabPanel id="python" label="Python">
+2
View File
@@ -30,6 +30,8 @@ custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/supab
Checkout 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