© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•13mo ago•
5 replies
kliuksas

Edge function, custom domain and `SUPABASE_URL` env variable

hello 👋

after setting up custom domain, i can call my edge function via that custom domain, but
SUPABASE_URL
SUPABASE_URL
env variable is pointing to the original URL and not to the custom domain.

i'm unable to change
SUPABASE_URL
SUPABASE_URL
env variable, due to error:

$ supabase secrets set SUPABASE_URL="https://api.my-new-domain.com"
Env name cannot start with SUPABASE_, skipping: SUPABASE_URL
Try rerunning the command with --debug to troubleshoot the error.
$ supabase secrets set SUPABASE_URL="https://api.my-new-domain.com"
Env name cannot start with SUPABASE_, skipping: SUPABASE_URL
Try rerunning the command with --debug to troubleshoot the error.


I'm using edge function to upload files to supabase storage and respond with the uploaded URL with:

const url = supabase.storage.from('my-bucket-name').getPublicUrl('my-file').data.publicUrl
const url = supabase.storage.from('my-bucket-name').getPublicUrl('my-file').data.publicUrl


the
url
url
is pointing to
https://abcdefgh.supabase.co/storage...
https://abcdefgh.supabase.co/storage...
instead of
https://api.my-new-domain.com/storage...
https://api.my-new-domain.com/storage...
.

i can fix this on my own by replacing the domain, still would be nice to avoid such juggling.

also posted on GH discussion: https://github.com/orgs/supabase/discussions/13371#discussioncomment-9469267
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Edge Function env setup
SupabaseSSupabase / help-and-questions
3y ago
How access env variable in edge function (self hosted) ?
SupabaseSSupabase / help-and-questions
6mo ago
Cant access SUPABASE_URL from my Edge function
SupabaseSSupabase / help-and-questions
3y ago
Supabase edge function issue
SupabaseSSupabase / help-and-questions
3w ago