Move API key from one environment to another

I’m developing a client side customization that leverages Functions, and to utilize this, I will need to create an API key and hard code it into the customization.
As far as I have seen, there is no way (hope I’m dead wrong on it) that one can move an API key from one environment to another.
In my mind, then the problem becomes changing the customization itself after being moved into a different environment to reference the new API key in the different environment.
Any thoughts?

Don’t hard code the API in the customization.

Store it somewhere (Company Config table perhaps) then look it up in your Customization.

Also you can’t copy an API form environment to environment (easily)

1 Like

Interesting, but same problem exists, yes?

Well the moving of the API problem does exist, but if you store the API Key (for internal use) in say Company Config you can just update it there and not touch the code.

1 Like

That’s a good plan, thanks

Also once you have it setup then you don’t ever have to change it in either system since it isn’t directly attached to the customization.

Insert disclaimers here about security practice and scope and blah blah blah

So you’re just saying extend the company config table to store it, then look it up in the customization, yes?

Correct, we do this with several “keys” that we need available (not API keys necessarely but file paths and crap like that)
Make a customization in Company Config add the custom fields and controls etc so that people can update them

Then use a BAQView or BOReader or CompanyAdapter to read them back out as needed.

Sweet I like it!

1 Like