Get supabase url from postgres
Hi, I am trying to construct the url of my edge function so i can call it with pg_net.
I hoped app.supabase.url would exist
function_url := current_setting('app.supabase.url', true) || '/functions/v1/push';
But it doesnt, is their a way to get the env variable or is there another setting?
6 Replies
You can use the available system side Supabase secrets

if I understand correctly, you want to build this call from inside another edge function?
There is no such environment variables setup in database functions. Currently you have to add this to vault and then retrieve it from vault. https://github.com/orgs/supabase/discussions/12813#discussioncomment-10422025
Ah but the secrets used for edge functions are also accessible through postgres or do i need to copy the same secrets to there?
You have to put the secret in vault. The edge function secrets are not available.
Ah tried this works like a charm thanks!