After creating your API key we recommend saving it as a global environment variable.
This has the following benefits:
- Prevents unauthorized access to your API key. By saving it as an environment variable, you can keep it separate from your codebase, reducing the risk of accidental exposure or leakage.
- It allows you to easily switch between different API keys or update them without modifying your code.
- When using our Python SDK, the command
sig.init()
will enable you to create a session linked to your API key.
Option 1: Set your environment variable via the command prompt
-
Open a command prompt window.
-
Run the following in the command prompt, replacing with your API key:
setx SIGTECH_API_KEY '<yourkey>'
-
Close your command prompt window.
-
Open a new command prompt window and validate that the environment variable has been set by running the command:
echo %SIGTECH_API_KEY%
Option 2: Set your environment variable using the control panel
- Select
Start
and then type "environment variable" into the search box. - Select
Edit environment variables for your account
. - Select
Environment Variables…
. - Select
New…
under your existing user variables. - Define your new variable:
- In
Variable name
, enterSIGTECH_API_KEY
. - In
Variable value
, enter your API key.
- In
Option 1: Set your environment variable using zsh
- Open a terminal window.
- Run the following command in your terminal, replacing your key with your API key.
echo "export SIGTECH_API_KEY='yourkey'" >> ~/.zshrc
- Update the shell with the new variable by running the following command:
source ~/.zshrc
- Confirm that you have set your environment variable by running the following command. The value of your API key will be the resulting output.
echo $SIGTECH_API_KEY
Option 2: Set your environment variable using bash
- Follow the directions above replacing
.zshrc
with.bash_profile
.
Check that this environment variable is set correctly by running the following command in your terminal or command prompt:
import sigtech.api as sig
sig.init()