Environments help you create variables that you can reuse in requests and scripts.
An environment allows you to group together a set of variable data. You can reference the variable data you define in an environment throughout Hoppscotch when sending requests or using scripts.
Environments are also useful when you need to manage shared variables with a team. You can create environments and share them with your workspace members.
Hoppscotch environment provides support for two types of variables
A Regular environment variable allows users to reference the variable throughout Hoppscotch, and anyone can see the value associated with the variable. In a shared workspace, regular environment variable-value pairs will be synced to the server, making them available to all workspace members. However, you have the option to choose whether to sync a personal or global environment.
A secret environment variable enables users to specify secrets and reference the values as variables. The values of secret variables in any workspace will never be synced to the server or shared with any workspace members. It is expected that the user will populate the value of the variable at runtime. All secret variable values in Hoppscotch will be masked using asterisks (***).
An environment variable can have two types of values:
Environment Variable | Secret Variable | |
---|---|---|
Workspace Owner | create / delete variable, edit value and use | create / delete secret variable, add values and use |
Workspace Editor | create / delete variable, edit value and use | create / delete secret variable, add value and use |
Workspace Viewer | use | add value and use |
Click on the ”Environments” icon on the sidebar to create environments.
A variable created in an environment can be used by typing the variable name enclosed in double angle brackets <<variable>>
You can also create and delete environment variables using scripts by using the pw
object..
Create a copy of an existing environment to modify or test different configurations without affecting the original:
- Duplicate
will be created.Learn how you can create environment variables from the client.
Learn how you can create environment variables using pre-request scripts.
Learn more pre-request script examples.
Environments help you create variables that you can reuse in requests and scripts.
An environment allows you to group together a set of variable data. You can reference the variable data you define in an environment throughout Hoppscotch when sending requests or using scripts.
Environments are also useful when you need to manage shared variables with a team. You can create environments and share them with your workspace members.
Hoppscotch environment provides support for two types of variables
A Regular environment variable allows users to reference the variable throughout Hoppscotch, and anyone can see the value associated with the variable. In a shared workspace, regular environment variable-value pairs will be synced to the server, making them available to all workspace members. However, you have the option to choose whether to sync a personal or global environment.
A secret environment variable enables users to specify secrets and reference the values as variables. The values of secret variables in any workspace will never be synced to the server or shared with any workspace members. It is expected that the user will populate the value of the variable at runtime. All secret variable values in Hoppscotch will be masked using asterisks (***).
An environment variable can have two types of values:
Environment Variable | Secret Variable | |
---|---|---|
Workspace Owner | create / delete variable, edit value and use | create / delete secret variable, add values and use |
Workspace Editor | create / delete variable, edit value and use | create / delete secret variable, add value and use |
Workspace Viewer | use | add value and use |
Click on the ”Environments” icon on the sidebar to create environments.
A variable created in an environment can be used by typing the variable name enclosed in double angle brackets <<variable>>
You can also create and delete environment variables using scripts by using the pw
object..
Create a copy of an existing environment to modify or test different configurations without affecting the original:
- Duplicate
will be created.Learn how you can create environment variables from the client.
Learn how you can create environment variables using pre-request scripts.
Learn more pre-request script examples.