Skip to content
This repository was archived by the owner on Nov 7, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,23 @@ implementation 'io.supabase:postgrest-kt:{version}'

### Initializing the client

## strings.xml
```xml
<resources>
<string name="base_url">https://1234.supabase.co/rest/v1</string>
<string name="supabase_url">db.1234.supabase.co</string>
<string name="supabase_key">eyJ1234c</string>
</resources>
```


```kotlin
val postgrestClient = PostgrestDefaultClient(
uri = URI("http://localhost:3111"),
headers = mapOf("Authorization" to "foobar")
var serviceKey: String = resources.getString(R.string.supabase_key);
val postgrestClient = PostgrestDefaultClient(
uri = URI(resources.getString(R.string.base_url)),
headers = mapOf("Authorization" to "Bearer $serviceKey", "apikey" to serviceKey)
)

```

You can also pass in a custom schema using the `schema` parameter.
Expand Down Expand Up @@ -206,4 +218,4 @@ val postgrestClient = PostgrestClient(
httpClient = customHttpClient(),
jsonConverter = customConverter()
)
```
```