v0 set up

    Store Your MLS API Key in v0

    Where v0 keeps secrets, how server code in your v0 app reads the key, and how to check it never reaches the page.

    Part of the v0 MLS API Integration guide · Last reviewed 2026-11-20

    Storing an MLS API key in v0 secrets

    In v0, an API key belongs in Environment Variables. Open the Project menu (the three dots), go to Settings, select Environment Variables, and add SAIGE_MLS_API_KEY with your key. Choose the environments it applies to: Production for the live app, Preview for preview deployments, and Development for the v0 preview panel. Add SAIGE_MLS_API_URL the same way, then tell v0 to use them in server code.

    Key takeaways

    • Path: Project menu, Settings, Environment Variables.
    • Select Development too, or the preview panel cannot see it.
    • No NEXT_PUBLIC_ prefix on the key.
    • Read with process.env.SAIGE_MLS_API_KEY in server code only.

    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 v0 keeps secrets

    v0's docs say environment variables are encrypted and stored securely on Vercel. v0 also has a Vars panel in the chat sidebar that adds variables the same way.

    • Open the Project menu (...) and go to Settings.
    • Select Environment Variables.
    • Add SAIGE_MLS_API_KEY with your key. Select Production, Preview and Development.
    • Add SAIGE_MLS_API_URL the same way.

    Reading the key in server code in your v0 app

    In a Next.js app, a route handler runs on the server. Read the key there with process.env and return only listing data to the page.

    Route handler reading the key (v0, Next.js)
    // app/api/listings/route.ts
    export async function GET() {
      const key = process.env.SAIGE_MLS_API_KEY;
      const base = process.env.SAIGE_MLS_API_URL;
      const res = await fetch(
        `${base}/Property?$filter=StandardStatus eq 'Active'&$top=24`,
        { headers: { Authorization: `Bearer ${key}` } }
      );
      return Response.json(await res.json());
    }

    Check before you publish

    Open the published v0 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

    Can I name it NEXT_PUBLIC_SAIGE_KEY?

    No. Next.js builds NEXT_PUBLIC_ values into the code browsers download, so visitors could read the key.

    Where are v0 environment variables stored?

    v0's docs say they are encrypted and stored on Vercel.

    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.

    MLS API for BC

    Put live MLS listings on the site you are building

    Saige is an approved MLS data vendor for Greater Vancouver REALTORS, Fraser Valley Real Estate Board, Chilliwack and District Real Estate Board and BC Northern Real Estate Board. Send a request and our team will contact you to check what your board allows and how to connect your builder.

    Call 604.401.4849