Description and usage of the app.config.yaml file app-config-yaml

This file determines the configuration for the application.

Who is this video for?

  • Developers new to Adobe Commerce with limited experience with Adobe App Builder who are learning about the app.config.yaml in the sample application.

Video content

  • The app.config.yaml file discussed
  • How are definitions link to other .js files
Transcript
In this video, we’ll talk about the app.config.yml file. This file is used to configure the application and declare actions and triggers. The sample extension is configured as seen in this screenshot. It points to the actions folder in line 2 and the web source folder for the front-end components on line 3. Actions are declared in line 9. As you can see, we have one action in our example called commerce-rest-get that codes a main function under actions-commerce-index.js file. This action is a web action that requires several inputs that are retrieved from the .env file. Here, the commerce URL, consumer key and token, and access token and token secret are required to connect to the commerce instance. Some annotations are also added and you can find more details about this accessing the link you can see on the screen.

Code Sample

# Specify your secrets here
# This file must not be committed to source control
## Adobe I/O Runtime credentials
AIO_runtime_auth=abcd1234-aaa-bbb-ccc-12345:Abcdd12345asdfadsfadsfee2323232323232
AIO_runtime_namespace=12345-someworkspace-stage
AIO_runtime_apihost=https://adobeioruntime.net
## Adobe I/O Console service account credentials (JWT) Api Key
SERVICE_API_KEY=

# You can also include commerce OAuth credentials, our sample module will use the following example credentials:
#COMMERCE_BASE_URL=https://somecommercewebsite.com/
#COMMERCE_CONSUMER_KEY=abcebdme5bvafnemk0mdeeiyfq123
#COMMERCE_CONSUMER_SECRET=ffff86sqws3pss5hhuofiqgq4t04rrr11
#COMMERCE_ACCESS_TOKEN=gdddfccronj098r4m04zyq773s5o64
#COMMERCE_ACCESS_TOKEN_SECRET=ggg7nb19jhr5gi9jzfan9ggzipe8yrus

You can see these static values being used in the sample module in file actions/commerce.index.js

        const oauth = getCommerceOauthClient(
            {
                url: params.COMMERCE_BASE_URL,
                consumerKey: params.COMMERCE_CONSUMER_KEY,
                consumerSecret: params.COMMERCE_CONSUMER_SECRET,
                accessToken: params.COMMERCE_ACCESS_TOKEN,
                accessTokenSecret: params.COMMERCE_ACCESS_TOKEN_SECRET
            },
            logger
        )
recommendation-more-help
3a5f7e19-f383-4af8-8983-d01154c1402f