When configuring an integration with the Formitize API, it is important to store your API token securely.
Never write your token into your integration's code. Store it in an environment variable or secrets store and have your code read it from there. This keeps the token separate from your code so it isn't copied, shared or saved alongside it. Store the token in a file named .env next to your script and add .env to your .gitignore so it is never committed to your code repository.
Wrap the value in double quotes:
FORMITIZE_API_TOKEN="1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c"Then run the script using the following command (Node.js 20.6 or later):
node --env-file=.env script.jsTesting in a terminal
macOS / Linux:
export FORMITIZE_API_TOKEN="1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c"Windows PowerShell:
$env:FORMITIZE_API_TOKEN = "1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c"Please Note: Never store your API token in publicly accessible files, spreadsheets, documents or code that runs in a web browser.