API Key Setup
Learn how to set up your API key
Background
In order to use the SDK, you first need to get the API key and set it properly. There are two ways to set up your API keys.
Direct use in your code
You can use your API key directly in your code.
But, committing an API key to your code repository is a common vector for credential compromise. So we strongly recommend the use of the environment variables as a proactive key safety measure.
Add to environment variables
Set your API key as your environment variable.
Linux / MacOS
Set your PODONOS_API_KEY
environment variable on your shell command.
Run the following command in your terminal, replacing YOUR_API_KEY
with your API key.
Once this is set, you can confirm that you have set your environment variable by using the following command.
Now, in your code, you can skip setting the api_key
while initialization.
Windows
Run the following in the cmd prompt, and replace <YOUR_API_KEY>
with your API key.
Once the variable is setup, you can validate that the variable has been set properly by opening a new cmd prompt window and typing in
All set! Let’s use the SDK.
Was this page helpful?