Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix(docs): use proper apikey instead of Authorization header for Functions examples (#46013)

Blut-agent15214d02de11
diff --git a/apps/docs/content/guides/functions/quickstart-dashboard.mdx b/apps/docs/content/guides/functions/quickstart-dashboard.mdx
index 4412d30a293..14db8b23f35 100644
--- a/apps/docs/content/guides/functions/quickstart-dashboard.mdx
+++ b/apps/docs/content/guides/functions/quickstart-dashboard.mdx
@@ -186,14 +186,14 @@ console.log(data) // { message: "Hello JavaScript!" }
const response = await fetch('https://[YOUR_PROJECT_ID].supabase.co/functions/v1/hello-world', {
method: 'POST',
headers: {
- Authorization: 'Bearer YOUR_PUBLISHABLE_KEY',
+ apikey: '<SUPABASE_PUBLISHABLE_KEY>',
'Content-Type': 'application/json',
},
body: JSON.stringify({ name: 'Fetch' }),
})
const data = await response.json()
-console.log(data) // { message: "Hello Fetch!" }
+console.log(data) // { message: "Hello there!" }
```
</TabPanel>
diff --git a/apps/docs/content/guides/functions/recursive-functions.mdx b/apps/docs/content/guides/functions/recursive-functions.mdx
index 580225f4d74..ad28b050c1e 100644
--- a/apps/docs/content/guides/functions/recursive-functions.mdx
+++ b/apps/docs/content/guides/functions/recursive-functions.mdx
@@ -97,7 +97,7 @@ Deno.serve(async (req) => {
const response = await fetch(`${Deno.env.get('SUPABASE_URL')}/functions/v1/other-function`, {
method: 'POST',
headers: {
- Authorization: `Bearer ${SUPABASE_DEFAULT_PUBLISHABLE_KEY}`,
+ apikey: SUPABASE_DEFAULT_PUBLISHABLE_KEY,
'Content-Type': 'application/json',
},
body: JSON.stringify({ foo: 'bar' }),
diff --git a/apps/docs/content/guides/functions/schedule-functions.mdx b/apps/docs/content/guides/functions/schedule-functions.mdx
index 1d9a54dc14b..222b938b6a4 100644
--- a/apps/docs/content/guides/functions/schedule-functions.mdx
+++ b/apps/docs/content/guides/functions/schedule-functions.mdx
@@ -47,7 +47,7 @@ select
url:= (select decrypted_secret from vault.decrypted_secrets where name = 'project_url') || '/functions/v1/function-name',
headers:=jsonb_build_object(
'Content-type', 'application/json',
- 'Authorization', 'Bearer ' || (select decrypted_secret from vault.decrypted_secrets where name = 'publishable_key')
+ 'apikey', (select decrypted_secret from vault.decrypted_secrets where name = 'publishable_key')
),
body:=concat('{"time": "', now(), '"}')::jsonb
) as request_id;