Supabase set up
Store Your MLS API Key in Supabase
Where Supabase keeps secrets, how a Supabase Edge Function reads the key, and how to check it never reaches the page.
Part of the Supabase MLS API Integration guide · Last reviewed 2026-11-20

In Supabase, an API key for an Edge Function belongs in Edge Function secrets. In the dashboard, open the Edge Function Secrets page, enter SAIGE_MLS_API_KEY as the Key and your key as the Value, and click Save. Or run supabase secrets set SAIGE_MLS_API_KEY=your-key from the CLI. Functions read it with Deno.env.get and pick up new secrets without redeploying.
Key takeaways
- Dashboard: Edge Function Secrets page, Key, Value, Save.
- CLI: supabase secrets set NAME=value.
- Locally: supabase/functions/.env, listed in .gitignore.
- Never use the SUPABASE_ prefix: it is reserved.
Need the data feed for this? Saige is an approved MLS data vendor in BC. Send a request and our team will contact you.
Where Supabase keeps secrets
For local work, Supabase's docs suggest a supabase/functions/.env file, added to .gitignore, which the local stack loads on supabase start.
- In the Supabase dashboard, open Edge Function Secrets.
- Key: SAIGE_MLS_API_KEY. Value: your key. Save.
- Add SAIGE_MLS_API_URL the same way.
- Or from the CLI: supabase secrets set SAIGE_MLS_API_KEY=your-key.
Reading the key in a Supabase Edge Function
Read the secrets inside the function with Deno.env.get. Supabase's own keys, such as SUPABASE_URL, are available to every function by default.
Deno.serve(async () => {
const key = Deno.env.get("SAIGE_MLS_API_KEY");
const base = Deno.env.get("SAIGE_MLS_API_URL");
const res = await fetch(
`${base}/Property?$filter=StandardStatus eq 'Active'&$top=24`,
{ headers: { Authorization: `Bearer ${key}` } }
);
return new Response(await res.text(), {
headers: { "Content-Type": "application/json" },
});
});Check before you publish
Open the published Supabase site, view the page source, and search for the first characters of your key. It must not be there. Then use the search page with the browser's network panel open: requests should go to your own server code, not straight to the feed address. The full check list is at Keep Your MLS API Key Secret on an AI-Built Site.
Frequently asked questions
Do I need to redeploy after changing a secret?
No. Supabase's docs say functions pick up new secrets without redeploying.
How do I list the secrets that are set?
Run supabase secrets list.
Related pages in this guide
Sources
Every claim on this page that could be checked against a primary source is linked below. Where something is not publicly documented by a vendor, the page says so rather than filling the gap with an estimate.
- Environment variables and secrets for Edge Functions (Supabase)
- Scheduling Edge Functions (Supabase)
- Auth (Supabase)
- Secrets Management Cheat Sheet (OWASP Foundation)