Replit set up

    Store Your MLS API Key in Replit

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

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

    Storing an MLS API key in Replit secrets

    In Replit, an API key belongs in Secrets. Open Tools at the top of the Project Editor, then Secrets under Setup, select New Secret, and enter SAIGE_MLS_API_KEY as the Key and your key as the Value. Add SAIGE_MLS_API_URL the same way. Replit makes secrets available to your code as environment variables, so Node reads process.env.SAIGE_MLS_API_KEY and Python reads os.environ.

    Key takeaways

    • Path: Tools, Secrets, New Secret, Add Secret.
    • Read with process.env (Node) or os.environ (Python).
    • Published apps have their own Production app secrets.
    • Bulk editing replaces all existing secrets, so review before saving.

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

    Replit keeps secrets per project. A published app can use different values for testing and production: open Publishing, then Adjust settings, and find Production app secrets.

    • Open the project and select Tools at the top.
    • Under Setup, select Secrets.
    • Select New Secret. Key: SAIGE_MLS_API_KEY. Value: your key. Select Add Secret.
    • Repeat for SAIGE_MLS_API_URL.

    Reading the key in your Replit app's server code

    Read the secrets in the server code only. Replit sets REPLIT_DEPLOYMENT to 1 in a published app, which you can use to tell production from testing.

    Server route reading the key (Replit, Node)
    app.get("/api/listings", async (req, res) => {
      const key = process.env.SAIGE_MLS_API_KEY;
      const base = process.env.SAIGE_MLS_API_URL;
      const r = await fetch(
        `${base}/Property?$filter=StandardStatus eq 'Active'&$top=24`,
        { headers: { Authorization: `Bearer ${key}` } }
      );
      res.json(await r.json());
    });

    Check before you publish

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

    My published Replit app cannot read the key.

    Check Production app secrets under Publishing, Adjust settings. Also check the app is not a Static Deployment.

    Can I link one secret to several Replit apps?

    Replit has Link Account Secrets for sharing a secret across apps. One key per site is easier to manage and replace.

    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