Skip to Content
FeaturesEnvironmentsStoring Secrets

Storing Secrets

Environment variable values are saved in JSON files in plain text. With Git Sync, these files are saved in your project and committed to Git, so anyone with access to the repository can read them. Keep API keys, passwords and tokens out of these files.

Options

Use one of these options for API keys, passwords and tokens:

  • Local Environment: keep secrets on your computer, out of your project and Git.
  • .env file: keep secrets in a .env file and add it to .gitignore.
  • Secret Managers (Enterprise): load secrets at run time from Azure Key Vault or AWS Secrets Manager.

Compare the Options

Local Environment.env FileSecret Managers
Where values are storedThunder Client’s global storage on your computerA file you choose, usually in your projectAzure Key Vault or AWS Secrets Manager
Kept out of GitAlwaysOnly if you add the file to .gitignoreAlways
Share with your teamEach teammate adds their own valuesEach teammate creates their own fileAccess is managed in your cloud account
CI/CDNot availableWorks with the CLINeeds a cloud login on the build machine
Price PlanPaidAll plansEnterprise

CI/CD

A CI/CD machine has no Local Environment. Store secrets in your CI/CD tool’s secret store, then pass them to the Thunder Client CLI in one of these ways:

  • Write them to a .env file during the build and link that file to the environment. See CI/CD.
  • Pass them with --var-data:
tc --col 'colNameOrId' --var-data "apiKey=$API_KEY"

Best Practices

  • Use the same variable names on every machine, such as {{apiKey}}, so shared requests work for everyone.
  • Add .env files to .gitignore before you add any secrets to them.
  • Never commit secret values to Git or share them in chat or email.
  • If a secret is committed to Git, rotate it. Removing it from the repository does not remove it from Git history.
Last updated on