Skip to content

Commit 93c202b

Browse files
committed
Add docs README and comments for runtime actions
1 parent 9717f62 commit 93c202b

6 files changed

Lines changed: 106 additions & 6 deletions

File tree

INSTALL.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Installation
2+
3+
Module compatible with both Adobe Commerce SaaS and PaaS.
4+
5+
## Prerequisites
6+
7+
- Node.js 20+
8+
- Adobe I/O CLI (`npm install -g @adobe/aio-cli`)
9+
10+
## Adobe Console preparation
11+
12+
Go to [Adobe Developer Console](https://developer.adobe.com) and create a new project from the "App Builder" template.
13+
14+
Adding a service "Adobe Commerce as a Cloud Service" is necessary for generating OAuth Server-to-Server credentials.
15+
16+
## Installation
17+
18+
- Clone the repository / download the zip
19+
- Run `npm install` for installing dependencies
20+
21+
## Environment variables
22+
23+
- Rename default `env.dist` to `.env` for storing environment variables
24+
25+
### Adobe Commerce SaaS ![Compatibility](https://img.shields.io/badge/SaaS%20only-006941)
26+
27+
Go to your project in the Adobe Developer console, and copy-paste the OAuth credentials into `.env` config as they are:
28+
29+
```env
30+
OAUTH_CLIENT_ID=
31+
OAUTH_CLIENT_SECRETS=
32+
OAUTH_TECHNICAL_ACCOUNT_EMAIL=
33+
OAUTH_TECHNICAL_ACCOUNT_ID=
34+
OAUTH_SCOPES=
35+
OAUTH_IMS_ORG_ID=
36+
```
37+
38+
### Adobe Commerce PaaS ![Compatibility](https://img.shields.io/badge/PaaS%20only-0469e3)
39+
40+
Create an integration in Adobe Commerce on `System > Integrations` (preferably with all permissions) and fill in the
41+
credentials into `.env` config:
42+
43+
```env
44+
COMMERCE_CONSUMER_KEY=
45+
COMMERCE_CONSUMER_SECRET=
46+
COMMERCE_ACCESS_TOKEN=
47+
COMMERCE_ACCESS_TOKEN_SECRET=
48+
```
49+
50+
Once you've finished with credentials, you have to connect your project in the Adobe Developer Console with your App
51+
Builder application by running the following commands:
52+
53+
```shell
54+
aio login
55+
aio console org select
56+
aio console project select
57+
aio console workspace select
58+
aio app use --merge
59+
```
60+
61+
Last step, you have to register your App Builder namespace in our external backoffice and generate a JWT token:
62+
63+
```shell
64+
npm run onboarding
65+
```
66+
67+
## Deploy the app
68+
69+
Congratulations! You're all set for deploying your app.
70+
71+
```shell
72+
aio app deploy
73+
```
74+
75+
## Admin UI SDK and enabling in Adobe Commerce
76+
77+
As our app is using Admin UI SDK for extending the admin panel, please be sure to enable it in your Adobe Commerce.
78+
79+
- Go to `System > Configuration > Adobe Services > Admin UI SDK`
80+
- Enable Admin UI SDK from `General configuration`
81+
- Click `Configure extensions` and be sure your extension is listed and checked
82+
- `Refresh registrations` for clearing the cache
83+
84+
Enjoy!

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# My Awesome App
2+
3+
Adobe App Builder is a serverless platform for building custom apps and extensions on top of Adobe products
4+
without managing infrastructure. It provides backend actions, UI apps, and secure API access to quickly
5+
implement business logic, integrations, and custom workflows.
6+
7+
## Installation
8+
9+
Follow instructions in the [installation guide](INSTALL.md).

actions/commerce/generic/index.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
/**
2-
* Extremely simple example of runtime action, which
3-
* can be used to call external APIs, receiving events
4-
* from Adobe Commerce or anything else.
2+
* Simple example of runtime action, which can be used to call external APIs,
3+
* receiving events from Adobe Commerce or for any other purpose.
4+
*
5+
* @see https://developer.adobe.com/app-builder/docs/guides/runtime_guides/using-runtime
56
*/
67

78
// eslint-disable-next-line no-unused-vars

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "@ideal-code/create-app-builder",
2+
"name": "my-awesome-app",
33
"version": "1.0.0",
44
"description": "My awesome App Builder app",
55
"license": "MIT",

src/commerce-backend-ui-1/actions/registration/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/**
2+
* Runtime action for providing registrations for Admin UI SDK.
3+
*
4+
* @see https://developer.adobe.com/commerce/extensibility/admin-ui-sdk/app-registration
5+
*/
6+
17
export const main = () => {
28
const extensionId = 'my_awesome_app'
39

0 commit comments

Comments
 (0)