mirror of
https://github.com/supabase/supabase.git
synced 2026-10-05 09:25:06 +03:00
docs: Key changes in API section (#44994)
## I have read the [CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md) file. YES/ <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Documentation** * Updated API docs and quickstart examples to reference publishable API keys in configuration snippets, cURL examples, and browser guidance. * Adjusted quickstart cURL examples to simplify headers and align with publishable-key usage. * Clarified security guidance to recommend distributing publishable keys where appropriate and updated related wording across guides. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: fadymak <dev@fadymak.com>
This commit is contained in:
1 parent
c0c6f70f02
commit
9a8ea280ed
3 files changed
+6
-7
No files matched your search
@@ -23,7 +23,7 @@ If you prefer to handle retries yourself, you can disable the built-in retry beh
|
||||
```javascript
|
||||
import { createClient } from '@supabase/supabase-js'
|
||||
|
||||
const supabase = createClient('https://your-project-id.supabase.co', 'your-anon-key', {
|
||||
const supabase = createClient('https://your-project-id.supabase.co', 'your-publishable-key', {
|
||||
db: {
|
||||
retry: false,
|
||||
},
|
||||
|
||||
@@ -174,15 +174,14 @@ We'll create a database table called `todos` for storing tasks. This creates a c
|
||||
|
||||
Find your API URL and Keys in your Dashboard [API Settings](/dashboard/project/_/settings/api). You can now query your "todos" table by appending `/rest/v1/todos` to the API URL.
|
||||
|
||||
Copy this block of code, substitute `<PROJECT_REF>` and `<ANON_KEY>`, then run it from a terminal.
|
||||
Copy this block of code, substitute `<PROJECT_REF>` and `<PUBLISHABLE_KEY>`, then run it from a terminal.
|
||||
|
||||
</StepHikeCompact.Details>
|
||||
<StepHikeCompact.Code>
|
||||
|
||||
```bash Terminal
|
||||
curl 'https://<PROJECT_REF>.supabase.co/rest/v1/todos' \
|
||||
-H "apikey: <ANON_KEY>" \
|
||||
-H "Authorization: Bearer <ANON_KEY>"
|
||||
-H "apikey: <PUBLISHABLE_KEY>"
|
||||
```
|
||||
|
||||
</StepHikeCompact.Code>
|
||||
@@ -197,9 +196,9 @@ There are several options for accessing your data:
|
||||
|
||||
### Browser
|
||||
|
||||
You can query the route in your browser, by appending the `anon` key as a query parameter:
|
||||
You can query the route in your browser, by appending the `publishable` key as a query parameter:
|
||||
|
||||
`https://<PROJECT_REF>.supabase.co/rest/v1/todos?apikey=<ANON_KEY>`
|
||||
`https://<PROJECT_REF>.supabase.co/rest/v1/todos?apikey=<PUBLISHABLE_KEY>`
|
||||
|
||||
### Client libraries
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ Some applications can benefit from using additional API keys managed by the appl
|
||||
|
||||
<Admonition type="tip">
|
||||
|
||||
Using the `apikey` header with the [Supabase API keys](/docs/guides/api/api-keys) is mandatory and not configurable. If you use additional API keys, you have to distribute both the `anon` API key and your application's custom API key.
|
||||
Using the `apikey` header with the [Supabase API keys](/docs/guides/api/api-keys) is mandatory and not configurable. If you use additional API keys, you have to distribute both the `publishable` API key and your application's custom API key.
|
||||
|
||||
</Admonition>
|
||||
|
||||
|
||||
Reference in new issue
Block a user