Ability to set different environment variables between Test vs Live

Options

I looked around and couldn't find a similar request, but I can't be the only one to run into this.

My request is pretty much just what is in the title. Right now it feels like I have to ‘hack' a solution to achieve the same pattern as I would in normal software development (i.e. set different environment variable values based on if I am in prod or non-prod). It makes environment variables pretty limited in usefulness right now especially if your apps communicates with a lot of external APIs.

Take Stripe for example - if I want to use env vars, I have to first do all of my development and testing using the test API keys that they give me, and then go back later and change the key once I want to go live in prod. Now once I am live there's really no way for me to do additional development or testing in their test environment without creating separate logic or just skip using environment variables altogether and store the secrets in a database table, setting different values for test vs live data sources, which seems to defeat the purpose of env variables altogether.

I really like the platform in general and I think this would do a lot to further set Xano apart especially for power users! None of the other low code platforms I have worked with seem to have been able to implement this pattern either yet.

Comments

  • Ray Deck
    Ray Deck Trusted Xano Expert ✭✭✭
    Options

    Hey, you could implement this by putting env vars in a table and request them at runtime (using a get record call) instead of using the built-in env vars. The table structure is the same between live and test, but the contents are different. That would handle live/test distinctions at the data source level.