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
tomaspozo
tomaspozo6d ago
You can use the available system side Supabase secrets
No description
tomaspozo
tomaspozo6d ago
if I understand correctly, you want to build this call from inside another edge function?
silentworks
silentworks6d ago
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
Idris
IdrisOP6d ago
Ah but the secrets used for edge functions are also accessible through postgres or do i need to copy the same secrets to there?
garyaustin
garyaustin6d ago
You have to put the secret in vault. The edge function secrets are not available.
Idris
IdrisOP5d ago
Ah tried this works like a charm thanks!

Did you find this page helpful?