Edit in GitHubLog an issue

Set up your Adobe Commerce Extensibility Starter Kit project

To get started with Adobe Commerce Extensibility Starter Kit:

Set up a project

Projects Overview describes the different types of projects and how to manage them. Here, we'll create a templated project.

  1. Log in to the Adobe Developer Console and select the desired organization from the dropdown menu in the top-right corner.

  2. Click Create new project from template.

    Create a project

  3. Select App Builder. The Set up templated project page displays.

    Templated project

  4. Specify a project title and app name. Make sure the Include Runtime with each workspace checkbox is selected. You can optionally create a custom workspace other than the default Stage workspace. To create a custom workspace, click Add Workspace, and enter a name and description. Click Save. The Console creates a project and workspaces.

    New workspace

  5. In your workspace, click the Add service pop-up menu and select API.

    Add an API to your workspace

  6. Add the following services to your workspace. Each service must be added individually. You can add multiple services simultaneously.

    • I/O Management API
    • I/O Events
    • Adobe I/O Events for Adobe Commerce

    Click one of these services, such as I/O Management API. Then click Next.

    Add an API to your workspace

  7. On the Configure API page, select the OAuth Server-to-Server option and click Save configured API.

    generate a key pair

    Note: You can set up server-to-server authentication using JSON Web Tokens (JWT). However, this method has been deprecated in favor of OAuth and must be replaced no later than January 1, 2025. See Service Account (JWT) Authentication for details on implementing this solution.

  8. Use the Add service pop-up menu to select and add the other required services.

  9. If you are using JWT authentication, unzip the downloaded config.zip file. The extracted config directory should contain a certificate_pub.crt and a private.key file. The private.key file is required to configure the Commerce Admin.

Download the workspace configuration file

The console can generate a JSON file that defines the configuration of your workspace. You will use this file to configure the Commerce Admin and to set up the Starter Kit.

To download a .json file containing your workspace configuration:

  1. Go to the overview page of your workspace.

  2. Click the Download All button in the top-right corner.

    The <Workspace-name>.json file downloads automatically. In this example, the file is named 977AmethystGazelle-1340225-Stage.json.

Create an integration in Adobe Commerce

A Commerce integration generates the consumer key, consumer secret, access token, and access token secret that are required to connect to the Starter Kit. It also identifies the available API resources that are needed for the integration.

Use the following steps to create and activate an integration.

  1. From the Admin, go to System > Extensions > Integrations.

  2. Click Add New Integration. The New Integration page displays.

    New integration

  3. Enter a name for the integration in the Name field. Leave the other fields blank.

  4. Click API under the Basic Settings menu to display the Available APIs screen. Change the value of the Resource Access drop-down menu to All.

  5. Click Integration Info and enter your Admin password in the Your Password field. Click Save to return to the Integration page.

  6. Click the Activate link in the grid.

    Activate link

  7. On the next page, click the Allow button to display the Integration Tokens for Extensions page.

    Integration tokens

    You will need the integration details (consumer key, consumer secret, access token, and access token secret) to configure the Starter Kit. Copy these values to a safe place and click Done.

Install Adobe I/O Events for Adobe Commerce (Commerce 2.4.4 and 2.4.5 only)

If you are running Adobe Commerce 2.4.4 or 2.4.5, you must install modules to enable eventing, as described in Install Adobe I/O Events for Adobe Commerce. These modules are installed automatically in subsequent versions of Commerce.

Starter Kit set-up and onboarding

You are now ready to download the Adobe Commerce Starter Kit and set up your development.

Download and configure the project

In the Beta phase of the Starter Kit project, an Adobe Commerce representative will send you a ZIP file containing the Starter Kit repo. For GA, the Starter Kit will be available in the Adobe Commerce Marketplace.

  1. Download and unzip the Starter Kit repo.

  2. Change directories to the downloaded repo and copy the env.dist file.

    Copied to your clipboard
    cd <download-directory> && cp env.dist .env
  3. Fill in the values in the .env file. The file describes where you can find the values for each environment variable.

Configure the project

  1. Install npm dependencies:

    Copied to your clipboard
    npm install
  2. Run the following Adobe I/O commands to connect your Starter Kit project to the App Builder project you created earlier:

    Copied to your clipboard
    aio login
    aio console org select
    aio console project select
    aio console workspace select
  3. Sync your local application with the App Builder project using the following command:

    Copied to your clipboard
    aio app use --merge
  4. The app.config.yaml in the repo's root directory defines which packages to deploy. The Starter Kit provides packages for Commerce products, customers, orders, and stocks and their external back office counterparts. Comment out any packages that you do not need to deploy. In the following example, the ingestion package has been disabled:

    Copied to your clipboard
    application:
    runtimeManifest:
    packages:
    # ingestion:
    # license: Apache-2.0
    # actions:
    # $include: ./actions/ingestion/actions.config.yaml
    webhook:
    license: Apache-2.0
    actions:
    $include: ./actions/webhook/actions.config.yaml
    product-commerce:
    license: Apache-2.0
    actions:
    $include: ./actions/product/commerce/actions.config.yaml
    product-backoffice:
    license: Apache-2.0
    actions:
    $include: ./actions/product/external/actions.config.yaml
    customer-commerce:
    license: Apache-2.0
    actions:
    $include: ./actions/customer/commerce/actions.config.yaml
    customer-backoffice:
    license: Apache-2.0
    actions:
    $include: ./actions/customer/external/actions.config.yaml
    order-commerce:
    license: Apache-2.0
    actions:
    $include: ./actions/order/commerce/actions.config.yaml
    order-backoffice:
    license: Apache-2.0
    actions:
    $include: ./actions/order/external/actions.config.yaml
    stock-commerce:
    license: Apache-2.0
    actions:
    $include: ./actions/stock/commerce/actions.config.yaml
    stock-backoffice:
    license: Apache-2.0
    actions:
    $include: ./actions/stock/external/actions.config.yaml

Deploy the project

Run the following command to deploy the project. The command deploys the runtime actions needed for the onboarding step:

Copied to your clipboard
aio app deploy

You can confirm the success of the deployment in the Adobe Developer Console by navigating to the Runtime section on your workspace.

Adobe I/O Runtime actions

Onboarding

The onboarding process configures event registrations and completes the eventing configuration in Adobe Commerce.

Configure the event registrations

By default, the ./onboarding/custom/starter-kit-registrations.json config file creates all the registrations for all entities that are present in the repo's app.config.yaml file. You can edit this file to remove any unnecessary Commerce or back office registrations. For example, the YAML file shown in the Configure the project section comments out the product-backoffice package. In this case, you must remove backoffice from the product entity:

Copied to your clipboard
{
"product": ["commerce"],
"customer": ["commerce", "backoffice"],
"order": ["commerce", "backoffice"],
"stock": ["commerce", "backoffice"],
"shipment": ["commerce", "backoffice"]
}

Execute the onboarding

Run the following command to generate the IO Event providers and the registrations for your Starter Kit project.

Copied to your clipboard
npm run onboard

The console displays the provider's IDs. The commerce instance and provider IDs will be used to configure your Commerce instance. You will need the backoffice provider ID to send the events to the App builder project.

Copied to your clipboard
Process of On-Boarding done successfully: [
{
key: 'commerce',
id: '<Commerce Provider ID>',
instanceId: '<Instance ID of Commerce Provider',
label: 'Commerce Provider'
},
{
key: 'backoffice',
id: '<Backoffice Provider ID>',
instanceId: '<Instance ID of backoffice provider',
label: 'Backoffice Provider'
}
]

Check your App in the Developer Console to confirm the registrations were created.

Event registrations

Complete the Adobe Commerce eventing configuration

You must configure Commerce to communicate with your project. Configuration includes copying and pasting the contents of the workspace configuration file that you downloaded from the Adobe Developer Console.

  1. In the Commerce Admin, navigate to Stores > Settings > Configuration > Adobe Services > Adobe I/O Events > General configuration. The following screen displays.

    General configuration

  2. Select the server-to-server authorization method you implemented from the Adobe I/O Authorization Type menu. Adobe recommends using OAuth. JWT has been deprecated.

  3. Copy the contents of the <workspace-name>.json file into the Adobe I/O Workspace Configuration field.

  4. Enter a unique identifier in the Adobe Commerce Instance ID field. This value must contain English alphanumeric characters, underscores (_), and hyphens (-) only.

  5. Click Save Config, but do not leave the page. The next section creates an event provider, which is necessary to complete the configuration.

  6. Enable Commerce Eventing by setting Enabled to Yes.

    Note: You must enable cron so that Commerce can send events to the endpoint.

  7. Enter the merchant's company name in the Merchant ID field. You must use alphanumeric and underscores only.

  8. In the Environment ID field, enter a temporary name for your workspaces while in development mode. When you are ready for production, change this value to a permanent value, such as Production.

  9. (Optional) By default, if an error occurs when Adobe Commerce attempts to send an event to Adobe I/O, Commerce retries a maximum of seven times. To change this value, uncheck the Use system value checkbox and set a new value in the Maximum retries to send events field.

  10. (Optional) By default, Adobe Commerce runs a cron job (clean_event_data) every 24 hours that deletes event data three days old. To change the number of days to retain event data, uncheck the Use system value checkbox and set a new value in the Event retention time (in days) field.

  11. Click Save Config.

Subscribe to events in Adobe Commerce

Use the bin/magento events:subscribe command to subscribe to events, as described in Subscribe and register events. The following table defines the events for each supported entity that you must subscribe to and lists the required fields, if applicable.

EntityEventRequired fields
Product
observer.catalog_product_delete_commit_after
sku
Product
observer.catalog_product_save_commit_after
sku, created_at, updated_at
Customer
observer.customer_save_commit_after
created_at, updated_at
Customer
observer.customer_delete_commit_after
entity_id
Customer group
observer.customer_group_save_commit_after
customer_group_code
Customer group
observer.customer_group_delete_commit_after
customer_group_code
Order
observer.sales_order_save_commit_after
created_at, updated_at
Stock
observer.cataloginventory_stock_item_save_commit_after
product_id
  • Privacy
  • Terms of Use
  • Do not sell or share my personal information
  • AdChoices
Copyright © 2024 Adobe. All rights reserved.