.env is a special file that is not part of the sample module, but is important for use in your Adobe Developer App Builder application. This file contains secrets and other information. Avoid committing this file to any code repository.
In this video, we’ll talk about the .env file. To be able to run the application locally, deploy changes to App Builder, the .env file should be configured correctly. This file contains the needed secrets to connect to the developer console, as well as the secrets to connect to third parties, such as Commerce Instance in the context of this sample app.
Start by generating the .env file, running the aio app use command. The command will prompt you to select your project, and workspace, and the organization you’re logged into. Once done, the .env file will be created with the needed secrets to connect to your project on App Builder. Append the file was the additional secrets. For example, by adding the commerce URL, consumer key and consumer secret, access token and token secret to connect to an Adobe Commerce instance, It’s important to keep in mind that this file is for local use only. Make sure not to commit this file to your repository to avoid security issues, publishing secrets by mistake. To deploy using GitHub for CI/CD purposes, App Builder provides a way to configure credentials based on the GitHub secrets of your repository. Details can be found in the App Builder documentation, accessing the link on the screen.
# Specify your secrets here
# The .env file must not be committed to source control
## Adobe I/O Runtime credentials
## Adobe I/O Console service account credentials (JWT) Api Key
# You can include some commerce OAUTH credentials too, our sample module will use this
You can see these static values being used in the sample module in file
const oauth = getCommerceOauthClient(