# Configure Environments source: https://developer.mastercard.com/priceless-planet-carbon-tracker/tutorial/how-to-install-and-configure-insomnia-tool/configure-environments/index.md ## Configure Environments {#configure-environments} The Mastercard plugin for Insomnia will add the authorization header for Mastercard APIs when the following environment variable `mastercard` is set: * Configuration ```Configuration { "mastercard": { "consumerKey": "000000000000000000000000000000000000000000000000!000000000000000000000000000000000000000000000000", "keyAlias": "keyalias", "keystoreP12Path": "/path/to/sandbox-signing-key.p12", "keystorePassword": "keystorepassword" } } ``` You can create multiple environments in your workspace to store different configurations. For example, create one for Sandbox and one for Production to have them store different key information. For your convenience, we prepared a simple workspace template with the above environment configurations for you to simply import into your Insomnia app. Go to the next step for instructions. ## Import the Mastercard API Workspace Template {#import-the-mastercard-api-workspace-template} An Insomnia workspace template with a default environment is available for you to import into your Insomnia application. From the workspace dropdown menu (top left with down arrow), select **Import/Export.** ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/documentation/images/insomnia-6.png "Insomnia") Select **Import Data → From URL** ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/documentation/images/insomnia-7.png "Insomnia") Input the following URL: The template workspace is imported ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/documentation/images/insomnia-8.png "Insomnia") We are now in the Mastercard API Workspace. Open the **Environments** dropdown menu, you can see we have two Environments: **Sandbox** and **Production**. ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/documentation/images/insomnia-9.png "Insomnia") ## Manage Environments {#manage-environments} You can see the Environment variables with placeholder values. We need to fill in the real values with your API key. In the **Environments** dropdown menu, select **Manage Environments**. ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/documentation/images/insomnia-10.png "Insomnia") You can see the Environment variables with placeholder values. We need to fill in the real values with your API key. ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/documentation/images/insomnia-11.png "Insomnia") Tips: Notice that we added an environment variable host? It keeps the value of the base url of our Mastercard API endpoints: | Environment | Endpoint | | |-------------|--------------------------------------|---| | Sandbox | | | | Production | | | Using this environment variable, you can later write your request URL as **{{host}}/resource** instead of the the full URL. Depending on which environment is selected, the request will be sent to the host specified in that environment. We will show you a detailed example in later steps. ## Generate Carbon Calculator Experience API Credentials {#generate-carbon-calculator-experience-api-credentials} Sign in to [Mastercard Developers](http://developers.mastercard.com). Create a project with the APIs you would like to use (for example, Carbon Calculator Experience) or use an existing project. ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/uploads/insomnia-12.png "Insomnia") Fill in the details of your **Consumer Key** , **Path to Keystore (.p12)** , **Key Alias** and **Keystore Password**. See the example below for the Sandbox environment. You can do the same for Production environment if you have an approved Production key. ![Insomnia](https://static.developer.mastercard.com/content/priceless-planet-carbon-tracker/uploads/insomnia-13.png "Insomnia") Click **Done** to close the **Manage Environments** dialog. Now, you are ready to call the APIs that are authorized by the key you fill in.