Commit Graph
24 Commits
Author SHA1 Message Date
Katerina Skroumpelou 2013ebf417 docs: drop alpha labels and pin server and middleware imports to a major (#51031)
## Problem

`@supabase/middleware` ships as 1.0.0. The docs still label the
`pipeline` entry form of `withSupabase` alpha, and several snippets
import `npm:@supabase/server` and `npm:@supabase/middleware` with no
version or with a `^0.5.0` pin. A snippet without a version leaves
readers and tools to guess one, and a guessed version fails on deploy.

## Solution

- Removes the alpha wording from the middleware reference intro and
usage examples, the server frameworks partial, and the Bring your own
MCP guide. The `@supabase/server` 1.6.0 floor stays.
- Pins every `npm:@supabase/server` and `npm:@supabase/middleware`
import in the guides to a major range, `@1`, following the
`npm:@supabase/supabase-js@2` convention in Managing dependencies.
- Bumps the authenticated-mcp-server example to middleware `^1.0.0` and
server `^1.9.0`.

~~Blocked by supabase/middleware#49. The `@1` range resolves once 1.0.0
is on npm.~~




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

## Summary by CodeRabbit

* **Documentation**
* Updated authentication, API key, and MCP examples to use versioned
Supabase server and middleware packages.
* Clarified that pipeline and nested composition behave the same, and
that both require `@supabase/server` 1.6.0 or later.
* Removed alpha-status labels from `withSupabase` guidance while
retaining the 1.6.0 minimum-version requirement.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-09-30 17:27:44 +03:00
Illia Basalaiev 37a95fd912 docs: update edge functions limits and examples across guides (#49899) 2026-09-02 20:27:02 +02:00
Tomás PozoandChris Chinchilla 9d46004210 docs: rewrite Securing Edge Functions guide around @supabase/server (#45959)
## 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?

Docs update.

## What is the current behavior?

The "Securing Edge Functions" guide (`/docs/guides/functions/auth`)
opens with two conceptual sections — "Understanding authorization
headers" and "The `verify_jwt` platform check" — followed by a "Common
auth patterns" section that re-implements the same four use cases twice:
once without an SDK using `Deno.serve` + manual `createClient` + manual
`Authorization` header forwarding, and again using `@supabase/server`.
The recommended path is buried below background reading and a
legacy-style implementation.

Linear: COM-235.

## What is the new behavior?

The guide now leads with practical how-tos built on `@supabase/server`:

- Authenticated user calls (`auth: 'user'`)
- Service-to-service calls (`auth: 'secret'`)
- Public functions (`auth: 'none'`)
- External webhooks (`auth: 'none'` + signature verification)
- Combining modes
- Custom error responses
- Environment variables

The two conceptual sections are extracted into a new sibling page at
`/docs/guides/functions/auth-headers` ("Authorization headers"), linked
from the top of the how-to page and added to the side nav between
"Securing your functions" and "Legacy JWT secret".

The legacy SDK-less examples are removed. The mode table uses the
unnamed forms (`'secret'`, `'publishable'`), and a note in the
service-to-service section introduces the `'secret:<name>'` /
`'publishable:<name>'` syntax for callers that want to scope to a
specific named key.

## Additional context

Each section preserves the "who calls this and why" framing from the
original (cron jobs, workers, and `pg_net` for service-to-service;
`supabase.functions.invoke` for authenticated user calls; signed webhook
providers for external webhooks).

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

* **Documentation**
* Added a new guide explaining Edge Functions authentication headers,
JWT validation, and API key handling
* Redesigned core authentication guide to focus on the primary wrapper
approach with clearer examples and common scenarios
* Improved navigation and added redirects to make authentication docs
easier to find and access

<!-- review_stack_entry_start -->

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/supabase/supabase/pull/45959?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack)

<!-- review_stack_entry_end -->
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2026-05-18 08:43:23 -05:00
Kalleby Santos bcf54b0eaa fix: using 'authMode' instead of 'authType' (#45626)
## What kind of change does this PR introduce?

docs update

## What is the current behavior?

Current docs using `authType`

## What is the new behavior?

Using new `authMode` syntax
2026-05-06 09:36:29 +00:00
Kalleby Santos 937897a172 fix: applying '@supabase/server' sdk api changes (#45607) 2026-05-06 07:40:30 +00:00
Tomás Pozo 22e3ffc246 docs: fix anchor duplication (#45548)
## 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?

Small bug on https://supabase.com/docs/guides/functions/auth that shows
2 anchors with the same heading active.

## What is the current behavior?

Currently we show case 2 different implementations (raw and with server
sdk) in separate sections. Intentionally we want to show the same
heading under each section so is a 1-1 comparison. The issue is that
anchor links on the second section always point to the first section,
and on the navigation bar, both show as active.

## What is the new behavior?

Fix headings with proper custom anchors.


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

## Summary by CodeRabbit

* **Documentation**
* Enhanced authentication guide documentation with improved section
navigation anchors for better cross-reference linking and accessibility
within guides.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-04 20:55:52 -05:00
75aa1b9e40 docs: update edge functions integration guides with new server package (#45058)
## 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?

Update our documentation about securing Edge Functions using the new
supabase/server sdk.

## What is the current behavior?

Current documentation shows how to do a manual validation of the
incoming JWT. The new sdk abstracts that logic and provides a new DX.

## What is the new behavior?

None.

## Additional context

None.


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

* **Documentation**
* Updated Edge Functions authentication guide with explicit two-layer
auth patterns.
* Clarified header usage and distinction between user JWTs and API keys.
  * Documented platform JWT verification behavior and 401 handling.
* Added examples for user-authenticated calls, service-to-service calls,
public endpoints, and webhook handlers.
* Added server-side SDK patterns with configurable allow modes and
customizable auth responses.
  * Expanded environment variable reference for auth configuration.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Kalleby Santos <kalleby_santos@hotmail.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-04-27 11:14:21 +02:00
ec6e5ee05f docs: Update auth.mdx to include important note about local testing (#32946)
* Update auth.mdx to include important note about local testing

* Apply suggestions from code review

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
2026-01-13 07:15:39 +00:00
Kalleby SantosandChris Chinchilla 037e5f90a5 docs: improvements on securing Edge Functions guide (#41727)
* stamp: using CodeSample to dynamic load jwt examples

* stamp: lint

* stamp: using latest 'jose' lib on jwt examples

* stamp: update 'jose' lib link

* Update apps/docs/content/guides/functions/auth.mdx

---------

Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
2026-01-07 14:26:40 +00:00
0a8e264102 feat(docs): edge functions JWT Signing Keys guide (#41444)
* feat: edge functions legacy jwt auth guide

* stamp: adding `verify_jwt` disclaimer

* stamp: manual verify jwt example

* stamp: improving example

* stamp: improve supabase auth example

* feat: adding signing keys to jwt templates

* stamp: cleaning

* stamp: applying mdx-lint

* stamp: format

* stamp: applying ai suggestions

* stamp: improving jwt lib example

* stamp: cleaning

* stamp: typo

* stamp: applying suggestions

* stamp: applying suggestions

* stamp: applying improvements suggestions

* stamp: ponctuation typo

* stamp: ponctuation typo

* Update apps/docs/content/guides/functions/auth.mdx

* Update apps/docs/content/guides/functions/auth.mdx

* Apply suggestions from code review

* Update apps/docs/content/guides/functions/auth.mdx

* Update apps/docs/content/guides/functions/auth.mdx

* Update apps/docs/content/guides/functions/auth.mdx

* Update apps/docs/content/guides/functions/auth.mdx

---------

Co-authored-by: Chris Chinchilla <chris.ward@supabase.io>
Co-authored-by: Chris Chinchilla <chris@chrischinchilla.com>
2026-01-05 14:29:02 +01:00
Chris Chinchilla 336788b120 docs: Correct key usage in edge function docs (#38545)
Correct keys
2025-09-09 18:06:33 +10: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
Lydia HallieandCharis a26c01217d Update Edge Functions docs (#36798)
* Update Environment Variables docs

* Update Dependencies docs

* Add Function Configuration d ocs

* Add custom Configuration section in Navigation

* Add Error Handling section

* Add new HTTP Methods section

* Update Deno 2 Guide

* Update nav

* Rm deno2 nav

* Update Deploy section

* Update CI/CD section

* Update Logging

* Update Testing

* Update Local Debugging

* Update Troubleshooting

* Update Nav

* Update CLI Quickstart

* Update Dashboard Quickstart

* Update Development Environment

* Update Nav

* Fix links

* Update apps/docs/content/guides/functions/quickstart-dashboard.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/development-environment.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/development-environment.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/quickstart.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Use $CodeSample for multi-root example

* Use tocVideo instead of video embed

* Rm typo

* Switch Quickstart ordering

* Rephrase Docker requirement for deployment

* Add Project Structure section

* style: fix docs lint issues

* Update Regional Invocations

* Update Error Handing

* Fix linting

* Fixes

* Remove duplicate sections

* Update Auth integration

* Update Storage

* Update Database/Postgres

* Update Nav

* Update Background Tasks

* Update Ephemeral Storage

* Update Websockets

* Update Routing

* Update wasm

* Update AI models

* Fix linting issues

* Update apps/docs/content/guides/functions/ai-models.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/ai-models.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/ai-models.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/storage-caching.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/websockets.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/websockets.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Update apps/docs/content/guides/functions/ai-models.mdx

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>

* Rm unnecessary lines

* Rm wrong example

* Fix typo

* Rm deno2

* Move CICD to deployment and rename routing

* Fix whitespace

* rm unnecessary spelling

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-07-10 14:18:01 +00:00
Kevin Kuhl 82715efc25 Correct auth.mdx examples (#34746) 2025-06-12 20:55:24 +00:00
Lakshan Perera 3c390c7891 chore: Use npm specifier instead of jsr for supabase-js imports (#36291)
chore: update examples to use npm specifier instead of jsr
2025-06-09 22:36:48 -04:00
Filippo BrigatiandCharis 83947491f3 Add user token initialization in auth.mdx (#32997)
* Add user token in auth.mdx

I added the part of the code responsible for initializing the Supabase client with the token passed via the header, to ensure compliance with RLS (Row-Level Security).

As shown on this page:
https://github.com/supabase/supabase/blob/master/examples/edge-functions/supabase/functions/select-from-table-with-auth-rls/index.ts

Otherwise authentication will not be completed.

* make js compatible

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2025-06-02 16:02:49 -04:00
Rodrigo Mansueli f233c78794 Chore: update also last example on the page (#32809) 2025-01-16 06:28:41 +11:00
Rodrigo Mansueli 3e94bc483c Chore: update edge function example (#32808)
Update auth.mdx
2025-01-15 15:20:43 -03:00
Charis f4779d4844 refactor: migrate guides to app router (#23101)
Migrate guides to App Router.
2024-07-03 10:25:06 -04:00
Thor 雷神 Schaeff 0dbb5e5225 docs: update deno deps to jsr. (#27766)
docs: update deno desp to jsr.
2024-07-03 18:06:55 +08:00
grumpy-minerandCharis 5da928a0a1 Update auth.mdx - update fetching the user code example (#26614)
Update auth.mdx

Add constant authHeader in code example of Fetching the user

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-05-21 23:33:44 +00:00
ec86bbc4fe feat: new auth ia (#22812)
Co-authored-by: Kang Ming <kang.ming1996@gmail.com>
Co-authored-by: Joel Lee <lee.yi.jie.joel@gmail.com>
2024-05-07 20:15:06 +00:00
Simon HaandCharis 597c554e7a [WIP] 20771/fix auth get user for edge functions (#23155)
* docs: fix RPC sql example

* docs: fix auth.getUser() calls to use auth.getUser(jwt)

- add lines to get token before calling auth.getUser() as session is not
set after setting authHeader in client

* Apply suggestions from code review

---------

Co-authored-by: Charis <26616127+charislam@users.noreply.github.com>
2024-04-30 20:34:58 +00:00
Charis 42723d8232 refactor: move ai, realtime, functions, remaining auth docs to content directory (#21259) 2024-02-14 17:39:05 +00:00