Environment Variables

Environments are accessible throughout an entire API Project, so environment variables, unlike test variables, can be used in multiple API tests.

Environment variables are only accessible when executing a test on their housed environment. For example, this allows a user to have a development and a staging environment that both have an environment variable of authKey but use a different value for authKey in each environment.

There are two types of environment variables:

  • [Secret]: Secrets are key-value pairs that save sensitive data. The value field for secrets is obfuscated, so it is not visible to users.

  • [Variable] Variables are key-value pairs where the value is not obfuscated.

Creating a new Environment Variable

To create a new environment variable, head to the Testing Settings tab within RapidAPI Testing.

12891289

In this example, we have already created an environment called Production.

Secret

To create a secret, click the key icon in the environment you want to make the secret in.

12891289

Enter the secret Key and Secret, then click the green check to save.

12891289

Variable

To create a variable, click the + in the environment you want to make the variable in.

12921292

Enter the variable Key and Value, then click the green check to save.

12861286