Build with it
Keep Your MLS API Key Secret on an AI-Built Site
Where the key goes, where it must never go, and how to check before you publish.
Part of the MLS API for BC Real Estate Websites guide · Last reviewed 2026-11-20

An API key placed in page code is sent to every visitor's browser, where anyone can read it. Your MLS key must stay in the builder's secret storage and be used only by server code that runs on the builder's servers. Every builder in these guides has such a place: Secrets in Lovable, Base44, Bolt and Replit, environment variables in v0, the Secrets Manager in Wix, and the server side of WordPress. A leaked key lets someone else pull licensed MLS data under your name.
Key takeaways
- Never paste the key into the builder's chat or into page code.
- Store it in the builder's secret storage, under a name such as SAIGE_MLS_API_KEY.
- Only server code reads it. The page asks your server, and your server asks the API.
- Before publishing, search the live page's code for the key. It must not be there.
Need the data feed for this? Saige is an approved MLS data vendor in BC. Send a request and our team will contact you.
Why page code is not safe
Everything in a page's code reaches the visitor's browser, and a browser's developer tools show it in a few clicks. Environment variables whose names start with VITE_ or NEXT_PUBLIC_ are built into page code on purpose. When a prompt does not say where the key belongs, check where the builder put it.
The Secrets Management Cheat Sheet, a security guide published by the OWASP Foundation, advises keeping secrets out of code and in a dedicated secret store. Every builder below has one.
Where the key goes in each builder
Each builder hub has a step-by-step page for this. In short:
- Lovable: More, then Settings, then Secrets. Read with Deno.env.get in an Edge Function, or in a server function in newer apps. See Store Your MLS API Key in Lovable.
- Base44: Dashboard, then Secrets, then Add Secret. Read in a backend function. See Store Your MLS API Key in Base44.
- Bolt: the database icon, then Secrets. Read in a server function. See Store Your MLS API Key in Bolt.
- Replit: Tools, then Secrets, then New Secret. Read as an environment variable. See Store Your MLS API Key in Replit.
- v0: Settings, then Environment Variables. Read in server code only. See Store Your MLS API Key in v0.
- WordPress: wp-config.php or a server setting, read in PHP. See Store Your MLS API Key in WordPress.
Never paste it into the chat
The builder's chat history is stored with the project and may be seen by anyone with access to it. Lovable's own docs say to enter keys in the Add secret form, not the chat. Tell the builder the name of the secret, and add the value yourself in the secret storage.
Check before you publish
Open the published site, view the page source, and search for the first few characters of your key. Then open the browser's network panel, use the search page, and check that requests go to your own site's server code, not straight to the feed address. If you find the key anywhere, remove it, and ask our team to replace the key.
Frequently asked questions
What happens if my key leaks?
Someone could pull MLS data under your access, which can break your board's rules. Contact our team at once so the key can be replaced, and remove it from wherever it appeared.
Can I use the key in Framer or another builder with no server?
Not directly. A builder that runs only in the browser cannot hide a key. You need a small server in between. The Framer and Webflow guides show how.
Is a Supabase anon key the same kind of secret?
No. Supabase designs its public (anon or publishable) key for browser use with row level security. Your MLS key is a private key and belongs only in server-side secrets.
Should staff each have their own key?
One key per site is easier to manage. If a site is rebuilt or moved, ask for a new key and retire the old one.
Can I put the key in a .env file?
For local work with Cursor or Claude Code, yes, as long as the .env file is listed in .gitignore so it never reaches GitHub. On the live site, use the host's secret settings.
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.
- Secrets Management Cheat Sheet (OWASP Foundation)
- Secrets (Lovable)
- Managing app secrets (Base44)
- Secrets (Bolt)
- Secrets (Replit)
- External APIs (v0)