Commit Graph
8 Commits
Author SHA1 Message Date
Kody JacksonandClaude Sonnet 5.5 ceae23e199 docs: add cross-links in guides (AI, API, Auth, Database, Functions, deployment) (#53560)
## What

Adds internal cross-links to docs guides

## Testing

- Prettier passes on the changed lines.
- Docs build passes (`pnpm build --filter=docs`).
- Docs link e2e run locally against the production build for every
changed page across this PR

---------

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-18 08:57:10 -06:00
Kunal IngawaleandKaterina Skroumpelou 73260dfaba docs: correct the built-in retry behaviour in the supabase-js retry guide (#50749)
## Problem

[The built-in retry
guide](https://supabase.com/docs/guides/api/automatic-retries-in-supabase-js)
describes retry behaviour that `supabase-js` doesn't have. Three claims
in the "Built-in retries for PostgREST queries" section don't match the
code:

| The page says | The code does |
| --- | --- |
| "POST requests (used by PostgREST) are retried" | POST is **never**
retried |
| Retries cover "408, 409, 503 and 504" | Only `503` and `520` |
| "exponential backoff with jitter" | No jitter — the delay is
deterministic |

**The POST claim is the serious one.** It tells a reader that their
writes are retried when they aren't, which invites exactly the wrong
conclusion about how to handle a failed insert. Someone reading this
page would reasonably skip their own retry or idempotency handling on
writes, on the strength of a guarantee the library doesn't make.

The source of truth, from
`packages/core/postgrest-js/src/types/common/common.ts` on `supabase-js`
master:

```ts
export const RETRYABLE_STATUS_CODES = [520, 503] as const
export const RETRYABLE_METHODS = ['GET', 'HEAD', 'OPTIONS'] as const
export const DEFAULT_MAX_RETRIES = 3
export const getRetryDelay = (attemptIndex: number): number =>
  Math.min(1000 * 2 ** attemptIndex, 30000)
```

`shouldRetry` in `packages/core/postgrest-js/src/fetchWithRetry.ts`
gates on both constants, so a request is retried only when the method is
in `RETRYABLE_METHODS` *and* the status is in `RETRYABLE_STATUS_CODES`.
`getRetryDelay` is a pure function of the attempt index, with no random
component — hence no jitter.

There's a fourth, subtler consequence. The intro says built-in retries
apply to `.from()` and `.rpc()`, but `.rpc()` sends POST unless you pass
`{ get: true }` or `{ head: true }`, so RPC calls aren't retried by
default. A reader who takes the intro at face value would expect retries
on exactly the calls that don't get them.

## Solution

Corrected the three claims in place. No restructuring, no new sections,
no change to the `fetch-retry` half of the page.

- **Methods.** Replaced the sentence claiming POST is retried with the
actual rule, and stated the consequence plainly — a write is never sent
twice.
- **Status codes.** `503 Service Unavailable` and `520 Unknown Error` in
place of 408, 409, 503 and 504.
- **Jitter.** Dropped the word, since the backoff has none.
- **`.rpc()`.** Added one sentence noting that RPC sends POST by
default, so it isn't retried unless called with `{ get: true }`.

The diff is 3 changed lines and 2 added, all in one paragraph group.
This is a technical correction only — I deliberately left the page's
style and structure alone, so the diff stays readable as a single change
of one kind.

### Note on an incoming change

supabase/supabase-js#2699 proposes adding `521`, `522`, `523` and `524`
to `RETRYABLE_STATUS_CODES`. It is open, not merged. This PR documents
what `master` does today, and if that one lands the status sentence here
needs `520-524` rather than `520`. Happy to follow up with that change
once it merges, or to fold it in if you'd rather wait and land both
together.

## Review instructions

1. Open `packages/core/postgrest-js/src/types/common/common.ts` in
`supabase/supabase-js` on `master` and read `RETRYABLE_STATUS_CODES` and
`RETRYABLE_METHODS`.
2. Compare them against the live page's second paragraph. The status
list and the method list both differ.
3. Read `shouldRetry` in
`packages/core/postgrest-js/src/fetchWithRetry.ts` and confirm it
returns `false` for any method outside `RETRYABLE_METHODS`, POST
included.
4. Read `getRetryDelay` in the same `common.ts` and confirm there is no
random component, so "with jitter" doesn't hold.
5. Check `rpc()` in `packages/core/postgrest-js/src/PostgrestClient.ts`
and confirm the method is POST unless `get` or `head` is passed.
6. Read the preview page and confirm the corrected paragraphs say the
same thing the code does.

## Checklist

Check all before review:

- [x] I have read
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
- [x] If I wrote a new docs topic or edited an existing topic, I used
the `/write-the-docs` or `/edit-the-docs` skill, which references
[WORD_LIST](https://github.com/supabase/supabase/blob/master/apps/docs/WORD_LIST.md)
and the docs
[CONTRIBUTING](https://github.com/supabase/supabase/blob/master/apps/docs/CONTRIBUTING.md)
guide

## Additional context

One suggestion, which I've deliberately left out of the diff because
it's an addition rather than a correction — your call whether it belongs
on this page.

The guide sets no request timeout anywhere, in either the built-in
section or the `fetch-retry` examples. That matters because a retry only
fires once a request has failed. A request that is merely hanging never
fails, so it never triggers a retry, and the caller waits for whatever
the platform's own timeout turns out to be.

This isn't hypothetical. During a Cloudflare edge incident on 22
September 2026, PostgREST calls from Edge Functions stalled for 20 to 60
seconds and returned `522`. Supabase Support confirmed the elevated 522s
were platform-wide at the time rather than specific to one project. The
built-in retry fired on none of them — partly because `522` isn't in the
list, but also because a stalled request never reaches the retry check
at all.

A sentence pointing readers at `AbortSignal.timeout` alongside the retry
would close that gap:

```javascript
const { data, error } = await supabase
  .from('your_table')
  .select('*')
  .abortSignal(AbortSignal.timeout(10_000))
```

Happy to write that up as a short subsection if you want it — tell me
where you'd like it to sit and I'll open a separate PR so this
correction stays reviewable on its own.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Clarified that automatic retries apply only to idempotent GET, HEAD,
and OPTIONS requests that encounter HTTP 503 or 520 responses, or
network failures.
* Documented that RPC calls use POST by default and are not retried, and
that `{ get: true }` or `{ head: true }` can use retryable methods.
* Added guidance for using `AbortSignal.timeout(10_000)` to limit
requests that hang before retry handling.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Katerina Skroumpelou <sk.katherine@gmail.com>
2026-10-02 14:13:39 +03:00
Chris Chinchillaandfadymak 9a8ea280ed 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>
2026-04-21 15:48:46 +01:00
Laurence Isla 08e9cdde5e docs: data api docs functions (#44412)
## I have read the
[CONTRIBUTING.md](https://github.com/supabase/supabase/blob/master/CONTRIBUTING.md)
file.

YES

## What kind of change does this PR introduce?

Replaces "stored procedures" with "functions" for everything related to
the Data API.

## Additional context

It's not accurate to call database functions "stored procedures". It may
have been that way before Postgres 11, but now it causes confusion
because PostgREST allows functions and not stored procedures.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Standardized terminology across docs, SDK guides, CLI/config specs,
examples, UI, and config comments to use "database functions" instead of
"stored procedures".
* Updated API docs, CLI/config descriptions, Studio UI labels, help
text, empty-state and navigation copy, RPC documentation, and example
text for consistency.
* Adjusted explanatory text and error/help messages to reflect the
revised terminology.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-21 11:54:27 +10:00
fadymak 0939174a92 feat(docs): use publishable keys instead of anon keys in Auth guides (#44851)
With the upcoming deprecation of the anonymous and service role keys,
this PR updates the Auth guides to use the publishable key instead of
the soon-to-be-deprecated anonymous key.

It also standardizes the example strings to be:
`'https://your-project-id.supabase.co'` and `'sb_publishable_...'` for
consistency.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Standardized client initialization examples to use a consistent
publishable-key placeholder (`sb_publishable_...`) and full project URL
format.
* Replaced "anon key" wording with "publishable key" across auth and API
guides and examples.
* Minor formatting and import-order/whitespace improvements in code
samples for clarity and consistency.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-04-15 14:13:23 +02:00
61578be9b3 docs: update SDK reference docs and guides from recent SDK changes (#44629)
## Summary

Updates documentation based on SDK changes from 2026-02-16 to 2026-04-07
across all Supabase client SDKs.

### SDK changes analyzed

| SDK | Repository | Commits | Latest Tag |
|-----|-----------|---------|------------|
| JS | supabase/supabase-js | 78 | v2.104.0-canary.0 |
| Dart | supabase/supabase-flutter | 17 | - |
| Python | supabase/supabase-py | 11 | v2.28.3 |
| Swift | supabase/supabase-swift | 13 | v2.43.0 |
| Kotlin | supabase-community/supabase-kt | ~40 | 3.5.0 |
| C# | supabase-community/supabase-csharp | 0 (no changes) | v1.1.2 |

### Documentation updates

**Spec files:**
- **JS** (`supabase_js_v2.yml`): Added custom OIDC/OAuth provider admin
CRUD method refs (`createProvider`, `listProviders`, `getProvider`,
`updateProvider`, `deleteProvider`)
- **Dart** (`supabase_dart_v2.yml`): Added custom OAuthProvider class
example, `accessToken` param for `setSession()`, `useNewHostname`
storage option
- **Swift** (`supabase_swift_v2.yml`): Added PostgREST automatic retries
initialization example, realtime callback registration timing note
- **Kotlin** (`supabase_kt_v3.yml`): Added streaming edge functions
(SSE) example via `collectAsFlow`, `currentPassword` param for
`updateUser`, `urlLengthLimit`/`timeout` PostgREST config options

**Guides:**
- `api/automatic-retries-in-supabase-js.mdx`: Added built-in PostgREST
retry documentation (enabled by default since v2.102.0), restructured
guide to show native retries first, `fetch-retry` as advanced option
- `auth/passwords.mdx`: Added `currentPassword` verification section
with JS and Kotlin examples

## Test plan

- [ ] Verify YAML spec files parse correctly (validated locally with
Python yaml parser)
- [ ] Check that `$ref` entries for JS custom provider admin methods
resolve correctly against tsdoc
- [ ] Review rendered documentation for all updated spec sections
- [ ] Verify MDX guide pages render correctly with new Tabs/TabPanel
sections

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Documentation**
* Documented built-in automatic retries for PostgREST with exponential
backoff, retryable status codes, and option to disable per client
  * Retained prior fetch-retry guidance as a custom alternative
* Added guidance for verifying current password (version notes) and
admin APIs for custom OAuth providers
* Added PostgREST config options, streaming edge-function docs, and
clarified realtime subscription callback ordering
  * Allowed “retryable” in spelling rules
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
2026-04-13 13:38:46 +00:00
Stojan DimitrovskiandChris Chinchilla 93ba2a312c docs: indicate publishable key instead of anon in many examples (#37411)
* docs: indicate publishable key instead of anon in many examples

* replace your-anon-key to string indicating publishable or anon

* fix your_...

* apply suggestion from @ChrisChinchilla

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>

* Update keys in code examples

* Prettier fix

* Update apps/docs/content/guides/functions/schedule-functions.mdx

---------

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
2025-08-18 13:47:48 +02:00
Guilherme Souza fcdf11680a docs: add guide on how to implement retries in supabase-js (#31219) 2025-02-10 19:17:08 -03:00