Skip to content

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

docs: update edge function url format

Greg Richardsonc74380090979
diff --git a/apps/docs/layouts/guides/index.tsx b/apps/docs/layouts/guides/index.tsx
index 130e76e2510..16111871418 100644
--- a/apps/docs/layouts/guides/index.tsx
+++ b/apps/docs/layouts/guides/index.tsx
@@ -69,7 +69,7 @@ const Layout: FC<Props> = (props) => {
const ogPageType = asPath.split('/')[2]
// open graph image url constructor
const ogImageUrl = encodeURI(
- `https://obuldanrptloktxcffvn.functions.supabase.co/og-images?site=docs${
+ `https://obuldanrptloktxcffvn.supabase.co/functions/v1/og-images?site=docs${
ogPageType ? `&type=${ogPageType}` : ''
}&title=${props.meta?.title}&description=${props.meta?.description}`
)
diff --git a/apps/docs/pages/guides/ai/examples/headless-vector-search.mdx b/apps/docs/pages/guides/ai/examples/headless-vector-search.mdx
index 41dbde87ee4..9267986b634 100644
--- a/apps/docs/pages/guides/ai/examples/headless-vector-search.mdx
+++ b/apps/docs/pages/guides/ai/examples/headless-vector-search.mdx
@@ -87,7 +87,7 @@ const onSubmit = (e: Event) => {
isLoading.value = true
const query = new URLSearchParams({ query: inputRef.current!.value })
- const projectUrl = `https://your-project-ref.functions.supabase.co`
+ const projectUrl = `https://your-project-ref.supabase.co/functions/v1`
const queryURL = `${projectURL}/${query}`
const eventSource = new EventSource(queryURL)
diff --git a/apps/docs/pages/guides/database/extensions/pg_cron.mdx b/apps/docs/pages/guides/database/extensions/pg_cron.mdx
index fb4214c8f1c..f4f1739ade3 100644
--- a/apps/docs/pages/guides/database/extensions/pg_cron.mdx
+++ b/apps/docs/pages/guides/database/extensions/pg_cron.mdx
@@ -99,7 +99,7 @@ select
$$
select
net.http_post(
- url:='https://project-ref.functions.supabase.co/function-name',
+ url:='https://project-ref.supabase.co/functions/v1/function-name',
headers:='{"Content-Type": "application/json", "Authorization": "Bearer YOUR_ANON_KEY"}'::jsonb,
body:=concat('{"time": "', now(), '"}')::jsonb
) as request_id;
diff --git a/apps/docs/pages/guides/database/extensions/pg_net.mdx b/apps/docs/pages/guides/database/extensions/pg_net.mdx
index d7c9d8c7c62..9dcfdc64f17 100644
--- a/apps/docs/pages/guides/database/extensions/pg_net.mdx
+++ b/apps/docs/pages/guides/database/extensions/pg_net.mdx
@@ -157,7 +157,7 @@ Make a POST request to a Supabase Edge Function with auth header and JSON body p
```sql
select
net.http_post(
- url:='https://project-ref.functions.supabase.co/function-name',
+ url:='https://project-ref.supabase.co/functions/v1/function-name',
headers:='{"Content-Type": "application/json", "Authorization": "Bearer YOUR_ANON_KEY"}'::jsonb,
body:='{"name": "pg_net"}'::jsonb
) as request_id;
diff --git a/apps/docs/pages/guides/functions/quickstart.mdx b/apps/docs/pages/guides/functions/quickstart.mdx
index 26fcc5623c7..a28f5bf4adf 100644
--- a/apps/docs/pages/guides/functions/quickstart.mdx
+++ b/apps/docs/pages/guides/functions/quickstart.mdx
@@ -78,7 +78,7 @@ verify_jwt = false
You can invoke Edge Functions using curl:
```bash
-curl --request POST 'https://<project_ref>.functions.supabase.co/hello-world' \
+curl --request POST 'https://<project_ref>.supabase.co/functions/v1/hello-world' \
--header 'Authorization: Bearer ANON_KEY' \
--header 'Content-Type: application/json' \
--data '{ "name":"Functions" }'
diff --git a/apps/docs/pages/guides/functions/schedule-functions.mdx b/apps/docs/pages/guides/functions/schedule-functions.mdx
index fb4b0552824..2e53323e974 100644
--- a/apps/docs/pages/guides/functions/schedule-functions.mdx
+++ b/apps/docs/pages/guides/functions/schedule-functions.mdx
@@ -33,7 +33,7 @@ select
$$
select
net.http_post(
- url:='https://project-ref.functions.supabase.co/function-name',
+ url:='https://project-ref.supabase.co/functions/v1/function-name',
headers:='{"Content-Type": "application/json", "Authorization": "Bearer YOUR_ANON_KEY"}'::jsonb,
body:=concat('{"time": "', now(), '"}')::jsonb
) as request_id;
diff --git a/apps/www/components/LaunchWeek/7/Ticket/TicketActions.tsx b/apps/www/components/LaunchWeek/7/Ticket/TicketActions.tsx
index ad775d8a483..87fcd15a9ad 100644
--- a/apps/www/components/LaunchWeek/7/Ticket/TicketActions.tsx
+++ b/apps/www/components/LaunchWeek/7/Ticket/TicketActions.tsx
@@ -31,7 +31,7 @@ export default function TicketActions({
'twitter'
)}&via=supabase&text=${text}`
const linkedInUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${permalink('linkedin')}`
- const downloadUrl = `https://obuldanrptloktxcffvn.functions.supabase.co/lw7-ticket-og?username=${encodeURIComponent(
+ const downloadUrl = `https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw7-ticket-og?username=${encodeURIComponent(
username
)}`
const params = useParams()
diff --git a/apps/www/components/LaunchWeek/7/Ticket/TicketForm.tsx b/apps/www/components/LaunchWeek/7/Ticket/TicketForm.tsx
index babc14d61cf..a0e7deeb830 100644
--- a/apps/www/components/LaunchWeek/7/Ticket/TicketForm.tsx
+++ b/apps/www/components/LaunchWeek/7/Ticket/TicketForm.tsx
@@ -60,7 +60,7 @@ export default function TicketForm({ defaultUsername = '', setTicketGenerationSt
fetch(`/launch-week/tickets/${username}`).catch((_) => {})
// Prefetch ticket og image.
fetch(
- `https://obuldanrptloktxcffvn.functions.supabase.co/lw7-ticket-og?username=${encodeURIComponent(
+ `https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw7-ticket-og?username=${encodeURIComponent(
username ?? ''
)}`
).catch((_) => {})
diff --git a/apps/www/components/LaunchWeek/8/Ticket/TicketActions.tsx b/apps/www/components/LaunchWeek/8/Ticket/TicketActions.tsx
index 103e8b5e63b..914e8ee864e 100644
--- a/apps/www/components/LaunchWeek/8/Ticket/TicketActions.tsx
+++ b/apps/www/components/LaunchWeek/8/Ticket/TicketActions.tsx
@@ -30,7 +30,7 @@ export default function TicketActions({
const { userData, supabase } = useConfData()
const tweetUrl = `https://twitter.com/intent/tweet?url=${permalink}&via=supabase&text=${encodedText}`
const linkedInUrl = `https://www.linkedin.com/sharing/share-offsite/?url=${permalink}`
- const downloadUrl = `https://obuldanrptloktxcffvn.functions.supabase.co/lw8-ticket?username=${encodeURIComponent(
+ const downloadUrl = `https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw8-ticket?username=${encodeURIComponent(
username
)}`
const params = useParams()
diff --git a/apps/www/pages/launch-week/7/tickets/[username].tsx b/apps/www/pages/launch-week/7/tickets/[username].tsx
index be288f21893..14eedd28283 100644
--- a/apps/www/pages/launch-week/7/tickets/[username].tsx
+++ b/apps/www/pages/launch-week/7/tickets/[username].tsx
@@ -132,7 +132,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
golden = user?.golden ?? false
bg_image_id = user?.bg_image_id ?? 1
referrals = user?.referrals ?? 0
- ogImageUrl = `https://obuldanrptloktxcffvn.functions.supabase.co/lw7-ticket-og?username=${encodeURIComponent(
+ ogImageUrl = `https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw7-ticket-og?username=${encodeURIComponent(
username ?? ''
)}${golden ? '&golden=true' : ''}`
}
diff --git a/apps/www/pages/launch-week/7/tickets/index.tsx b/apps/www/pages/launch-week/7/tickets/index.tsx
index 37cfc0c287b..de398f62c21 100644
--- a/apps/www/pages/launch-week/7/tickets/index.tsx
+++ b/apps/www/pages/launch-week/7/tickets/index.tsx
@@ -27,7 +27,7 @@ const supabaseAdmin = createClient(
const generateOgs = async (users: UserData[]) => {
users?.map(async (user) => {
- const ogImageUrl = `https://obuldanrptloktxcffvn.functions.supabase.co/lw7-ticket-og?username=${encodeURIComponent(
+ const ogImageUrl = `https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw7-ticket-og?username=${encodeURIComponent(
user.username ?? ''
)}${!!user.golden ? '&golden=true' : ''}`
return await fetch(ogImageUrl)
diff --git a/apps/www/pages/launch-week/tickets/[username].tsx b/apps/www/pages/launch-week/tickets/[username].tsx
index 28b957b7659..d8246c9258e 100644
--- a/apps/www/pages/launch-week/tickets/[username].tsx
+++ b/apps/www/pages/launch-week/tickets/[username].tsx
@@ -144,7 +144,7 @@ export const getStaticProps: GetStaticProps = async ({ params }) => {
const { data: users } = await supabaseAdmin!.from('lw8_tickets_golden').select().limit(17)
fetch(
- `https://obuldanrptloktxcffvn.functions.supabase.co/lw8-ticket?username=${encodeURIComponent(
+ `https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw8-ticket?username=${encodeURIComponent(
username ?? ''
)}`
).catch((_) => {})
diff --git a/apps/www/pages/launch-week/tickets/index.tsx b/apps/www/pages/launch-week/tickets/index.tsx
index 1dbec06cf36..17875124813 100644
--- a/apps/www/pages/launch-week/tickets/index.tsx
+++ b/apps/www/pages/launch-week/tickets/index.tsx
@@ -28,7 +28,7 @@ const supabaseAdmin = createClient(
const generateOgs = async (users: UserData[]) => {
users?.map(async (user) => {
- const ogImageUrl = `https://obuldanrptloktxcffvn.functions.supabase.co/lw8-ticket-og?username=${encodeURIComponent(
+ const ogImageUrl = `https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw8-ticket-og?username=${encodeURIComponent(
user.username ?? ''
)}${!!user.golden ? '&golden=true' : ''}`
return await fetch(ogImageUrl)
diff --git a/apps/www/supabase/functions/launchweek-ticket-og/README.md b/apps/www/supabase/functions/launchweek-ticket-og/README.md
index 260f2a6457d..50104fcea85 100644
--- a/apps/www/supabase/functions/launchweek-ticket-og/README.md
+++ b/apps/www/supabase/functions/launchweek-ticket-og/README.md
@@ -4,7 +4,7 @@ Generate Open Graph images with Deno and Supabase Edge Functions and cache the g
- Docs: https://deno.land/x/[email protected]
- Examples: https://vercel.com/docs/concepts/functions/edge-functions/og-image-examples
-- Demo: https://obuldanrptloktxcffvn.functions.supabase.co/launchweek-ticket-og?username=thorwebdev
+- Demo: https://obuldanrptloktxcffvn.supabase.co/functions/v1/launchweek-ticket-og?username=thorwebdev
## Run locally
diff --git a/apps/www/supabase/functions/lw7-ticket-og/README.md b/apps/www/supabase/functions/lw7-ticket-og/README.md
index 3eaafadbae2..08ac5c8bfc9 100644
--- a/apps/www/supabase/functions/lw7-ticket-og/README.md
+++ b/apps/www/supabase/functions/lw7-ticket-og/README.md
@@ -4,7 +4,7 @@ Generate Open Graph images with Deno and Supabase Edge Functions and cache the g
- Docs: https://deno.land/x/[email protected]
- Examples: https://vercel.com/docs/concepts/functions/edge-functions/og-image-examples
-- Demo: https://obuldanrptloktxcffvn.functions.supabase.co/lw7-ticket-og?username=thorwebdev
+- Demo: https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw7-ticket-og?username=thorwebdev
## Run locally
diff --git a/apps/www/supabase/functions/lw7-ticket-og/handler.tsx b/apps/www/supabase/functions/lw7-ticket-og/handler.tsx
index 036ef6e10f4..b1a7c95d3e5 100644
--- a/apps/www/supabase/functions/lw7-ticket-og/handler.tsx
+++ b/apps/www/supabase/functions/lw7-ticket-og/handler.tsx
@@ -256,7 +256,7 @@ export async function handler(req: Request) {
)
if (storageError) throw new Error(`storageError: ${storageError.message}`)
// Generate image for gallery
- fetch('https://obuldanrptloktxcffvn.functions.supabase.co/lw7-ticket-gallery', {
+ fetch('https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw7-ticket-gallery', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
diff --git a/apps/www/supabase/functions/lw8-ticket/README.md b/apps/www/supabase/functions/lw8-ticket/README.md
index 9c5b3d4e49e..b7f60e0f9ec 100644
--- a/apps/www/supabase/functions/lw8-ticket/README.md
+++ b/apps/www/supabase/functions/lw8-ticket/README.md
@@ -4,7 +4,7 @@ Generate Open Graph images with Deno and Supabase Edge Functions and cache the g
- Docs: https://deno.land/x/[email protected]
- Examples: https://vercel.com/docs/concepts/functions/edge-functions/og-image-examples
-- Demo: https://obuldanrptloktxcffvn.functions.supabase.co/lw8-ticket?username=thorwebdev
+- Demo: https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw8-ticket?username=thorwebdev
## Run locally
diff --git a/apps/www/supabase/functions/lw8-ticket/handler.tsx b/apps/www/supabase/functions/lw8-ticket/handler.tsx
index 937982b919d..57c8d597fe4 100644
--- a/apps/www/supabase/functions/lw8-ticket/handler.tsx
+++ b/apps/www/supabase/functions/lw8-ticket/handler.tsx
@@ -252,7 +252,7 @@ export async function handler(req: Request) {
if (storageError) throw new Error(`storageError: ${storageError.message}`)
// Generate og image
- fetch('https://obuldanrptloktxcffvn.functions.supabase.co/lw8-ticket-og', {
+ fetch('https://obuldanrptloktxcffvn.supabase.co/functions/v1/lw8-ticket-og', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
diff --git a/examples/edge-functions/supabase/functions/get-tshirt-competition/README.md b/examples/edge-functions/supabase/functions/get-tshirt-competition/README.md
index b83a049526c..7ce099cbb2b 100644
--- a/examples/edge-functions/supabase/functions/get-tshirt-competition/README.md
+++ b/examples/edge-functions/supabase/functions/get-tshirt-competition/README.md
@@ -2,10 +2,10 @@
To celebrate the support of GET requests in Supabase Edge Functions we're giving away some limited edition Functions Shirts!
-To win a Supabase Edge Functions T-Shirt, make a GET request to https://obuldanrptloktxcffvn.functions.supabase.co/get-tshirt-competition with your email address, your Twitter handle (optional), your t-shirt size (S-2XL) and the correct answer, e.g.
+To win a Supabase Edge Functions T-Shirt, make a GET request to https://obuldanrptloktxcffvn.supabase.co/functions/v1/get-tshirt-competition with your email address, your Twitter handle (optional), your t-shirt size (S-2XL) and the correct answer, e.g.
```text
-https://obuldanrptloktxcffvn.functions.supabase.co/[email protected]&twitter=thorwebdev&size=2XL&answer=20
+https://obuldanrptloktxcffvn.supabase.co/functions/v1/[email protected]&twitter=thorwebdev&size=2XL&answer=20
```
You can read the functions source code to figure out the answer ;)
diff --git a/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/README.md b/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/README.md
index 05158fd957e..c017da00660 100644
--- a/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/README.md
+++ b/examples/edge-functions/supabase/functions/og-image-with-storage-cdn/README.md
@@ -4,7 +4,7 @@ Generate Open Graph images with Deno and Supabase Edge Functions and cache the g
- Docs: https://deno.land/x/[email protected]
- Examples: https://vercel.com/docs/concepts/functions/edge-functions/og-image-examples
-- Demo: https://obuldanrptloktxcffvn.functions.supabase.co/launchweek-ticket-og?ticketNumber=1234&username=thorwebdev&name=Thor%20%E9%9B%B7%E7%A5%9E%20Schaeff
+- Demo: https://obuldanrptloktxcffvn.supabase.co/functions/v1/launchweek-ticket-og?ticketNumber=1234&username=thorwebdev&name=Thor%20%E9%9B%B7%E7%A5%9E%20Schaeff
## Run locally
diff --git a/examples/edge-functions/supabase/functions/telegram-bot/README.md b/examples/edge-functions/supabase/functions/telegram-bot/README.md
index 6abc07c5ba3..3b42765655a 100644
--- a/examples/edge-functions/supabase/functions/telegram-bot/README.md
+++ b/examples/edge-functions/supabase/functions/telegram-bot/README.md
@@ -9,5 +9,5 @@ Try it out: https://t.me/supabase_example_bot
1. Run `supabase functions deploy --no-verify-jwt telegram-bot`
2. Get your Telegram token from https://t.me/BotFather
3. Run `supabase secrets set TELEGRAM_BOT_TOKEN=your_token FUNCTION_SECRET=random_secret`
-4. Set your bot's webhook url to `https://<PROJECT_REFERENCE>.functions.supabase.co/telegram-bot` (Replacing `<...>` with respective values). In order to do that, run this url (in your browser, for example): `https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/setWebhook?url=https://<PROJECT_REFERENCE>.functions.supabase.co/telegram-bot?secret=<FUNCTION_SECRET>`
-5. That's it, go ahead and chat with your bot πŸ€–πŸ’¬
\ No newline at end of file
+4. Set your bot's webhook url to `https://<PROJECT_REFERENCE>.functions.supabase.co/telegram-bot` (Replacing `<...>` with respective values). In order to do that, run this url (in your browser, for example): `https://api.telegram.org/bot<TELEGRAM_BOT_TOKEN>/setWebhook?url=https://<PROJECT_REFERENCE>.supabase.co/functions/v1/telegram-bot?secret=<FUNCTION_SECRET>`
+5. That's it, go ahead and chat with your bot πŸ€–πŸ’¬
diff --git a/supabase/functions/og-images/README.md b/supabase/functions/og-images/README.md
index c2a093815df..dc880c0c010 100644
--- a/supabase/functions/og-images/README.md
+++ b/supabase/functions/og-images/README.md
@@ -1,6 +1,6 @@
# Open Graph (OG) Image Generator
-Generate OG Images for the sites at supabase.
+Generate OG Images for the sites at supabase.
## How to use
@@ -20,7 +20,7 @@ If any of the required parameters are missing, you will receive a 404 response w
Here is an example link that you can use to test the website:
-https://obuldanrptloktxcffvn.functions.supabase.co/og-images?site=docs&title=Example%20Title&description=Example%20Description&type=Auth&icon=google
+https://obuldanrptloktxcffvn.supabase.co/functions/v1/og-images?site=docs&title=Example%20Title&description=Example%20Description&type=Auth&icon=google
This link will generate an image for the docs site with the title "Example Title", the description "Example Description", the Auth type, and the Google icon.
@@ -33,6 +33,7 @@ supabase start
```
Then run the function
+
```bash
supabase functions serve og-images
```