Skip to content

Commit a4299a4

Browse files
authored
Merge pull request #2 from comwrap/review-v2-2
Address Adobe Reviews + Add Oauth to exposed variables
2 parents 0930d08 + 6b71529 commit a4299a4

14 files changed

Lines changed: 2292 additions & 3895 deletions

INSTALL.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# Installation instructions for configing Adobe Commerce and Hubspot integration
1+
# Installation instructions for configuring Adobe Commerce and Hubspot integration
22

33
## Application
44

55
### Create App Builder project
66
Go to the [Adobe developer console](https://developer.adobe.com/console) portal
77
- Click on `Create a new project from template`
88
- Select `App Builder`
9-
- Chose a name and title
9+
- Choose a name and title
1010
- Select stage workspace or create a new one
1111
- Add the following API services (select default Oauth server to server)
1212
- I/0 events
1313
- Adobe I/O Events for Adobe Commerce
1414
- I/O management API
1515
- Download the [workspace configuration JSON](https://developer.adobe.com/commerce/extensibility/events/project-setup/#download-the-workspace-configuration-file) file and save it as `workspace.json` in the `./scripts/onboarding/config` folder because you will use it to configure Adobe IO Events in commerce afterward.
1616

17-
### Configure a new Integration in commerce
17+
### Configure a new Integration in commerce ![Compatibility](https://img.shields.io/badge/PaaS%20Only-0000FF)
1818
Configure a new Integration to secure the calls to Commerce from App Builder using OAuth by following these steps:
1919
- In the Commerce Admin, navigate to System > Extensions > Integrations.
2020
- Click the `Add New Integration` button. The following screen displays
@@ -26,7 +26,7 @@ Configure a new Integration to secure the calls to Commerce from App Builder usi
2626
- In the list of integrations, activate your integration.
2727
- To configure the module, you will need the integration details (consumer key, consumer secret, access token, and access token secret).
2828

29-
### Install Commerce Eventing module (only required when running Adobe Commerce versions 2.4.4 or 2.4.5)
29+
### Install Commerce Eventing module (only required when running Adobe Commerce versions 2.4.4 or 2.4.5) ![Compatibility](https://img.shields.io/badge/PaaS%20Only-0000FF)
3030
Install Adobe I/O Events for Adobe Commerce module in your commerce instance following this [documentation](https://developer.adobe.com/commerce/extensibility/events/installation/)
3131

3232
> **Note**
@@ -85,7 +85,7 @@ The console will return the provider's IDs and save this information:
8585

8686
Check your App developer console to confirm the creation of the registrations.
8787

88-
### Complete the Adobe Commerce eventing configuration
88+
### Complete the Adobe Commerce eventing configuration ![Compatibility](https://img.shields.io/badge/PaaS%20Only-0000FF)
8989

9090
> **Note**
9191
>
@@ -168,7 +168,7 @@ HUBSPOT_FULL_IMPORT_CONTACT_WEBSITE=
168168
169169
### Hubspot -> Adobe Commerce sync
170170
171-
Part of the tion HubSpot integration involves enabling the synchronization of changes made in HubSpot back to Adobe Commerce.
171+
Part of the HubSpot integration involves enabling the synchronization of changes made in HubSpot back to Adobe Commerce.
172172
173173
Currently supported:
174174
@@ -177,7 +177,7 @@ Currently supported:
177177
178178
To achieve it you need to have access to "Automation" configuration on Hubspot side.
179179
180-
This integration coming with pre-build Hubspot onboarding script.
180+
This integration coming with pre-built Hubspot onboarding script.
181181
182182
Please run:
183183
@@ -191,7 +191,7 @@ After creating 2 workflows, you need to go into each of them and add 3 secrets,
191191
192192
* clientId - App Builder Client ID
193193
* clientSecret - App Builder Client Secret
194-
* providerId - App Builder provider ID for incomin events
194+
* providerId - App Builder provider ID for incoming events
195195
196196
So your custom code configuration will look at the end like following:
197197
@@ -248,7 +248,7 @@ Custom script you can find:
248248
scripts/lib/hubspot/workflow_customer.js
249249
```
250250
251-
## Run initial synchornization
251+
## Run initial synchronization
252252
253253
After you are done with installation steps, you can run initial synchronization. Module provides an API endpoint to start the sync process:
254254

actions/customer/commerce/actions.config.yaml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
consumer:
22
function: consumer/index.js
33
web: 'no'
4-
runtime: nodejs:20
4+
runtime: nodejs:22
55
inputs:
66
LOG_LEVEL: debug
77
COMMERCE_HUBSPOT_CONTACT_ID_FIELD: $COMMERCE_HUBSPOT_CONTACT_ID_FIELD
@@ -12,7 +12,7 @@ consumer:
1212
created:
1313
function: created/index.js
1414
web: 'no'
15-
runtime: nodejs:20
15+
runtime: nodejs:22
1616
inputs:
1717
LOG_LEVEL: debug
1818
HUBSPOT_ACCESS_TOKEN: $HUBSPOT_ACCESS_TOKEN
@@ -22,13 +22,19 @@ created:
2222
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
2323
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
2424
COMMERCE_HUBSPOT_CONTACT_ID_FIELD: $COMMERCE_HUBSPOT_CONTACT_ID_FIELD
25+
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
26+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
27+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
28+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
29+
OAUTH_ORG_ID: $OAUTH_ORG_ID
30+
OAUTH_SCOPES: $OAUTH_SCOPES
2531
annotations:
2632
require-adobe-auth: true
2733
final: true
2834
updated:
2935
function: updated/index.js
3036
web: 'no'
31-
runtime: nodejs:20
37+
runtime: nodejs:22
3238
inputs:
3339
LOG_LEVEL: debug
3440
HUBSPOT_ACCESS_TOKEN: $HUBSPOT_ACCESS_TOKEN
@@ -38,13 +44,19 @@ updated:
3844
COMMERCE_CONSUMER_SECRET: $COMMERCE_CONSUMER_SECRET
3945
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
4046
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
47+
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
48+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
49+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
50+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
51+
OAUTH_ORG_ID: $OAUTH_ORG_ID
52+
OAUTH_SCOPES: $OAUTH_SCOPES
4153
annotations:
4254
require-adobe-auth: true
4355
final: true
4456
company-created:
4557
function: company-created/index.js
4658
web: 'no'
47-
runtime: nodejs:20
59+
runtime: nodejs:22
4860
inputs:
4961
LOG_LEVEL: debug
5062
HUBSPOT_ACCESS_TOKEN: $HUBSPOT_ACCESS_TOKEN
@@ -54,13 +66,19 @@ company-created:
5466
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
5567
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
5668
COMMERCE_HUBSPOT_CONTACT_ID_FIELD: $COMMERCE_HUBSPOT_CONTACT_ID_FIELD
69+
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
70+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
71+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
72+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
73+
OAUTH_ORG_ID: $OAUTH_ORG_ID
74+
OAUTH_SCOPES: $OAUTH_SCOPES
5775
annotations:
5876
require-adobe-auth: true
5977
final: true
6078
company-updated:
6179
function: company-updated/index.js
6280
web: 'no'
63-
runtime: nodejs:20
81+
runtime: nodejs:22
6482
inputs:
6583
LOG_LEVEL: debug
6684
HUBSPOT_ACCESS_TOKEN: $HUBSPOT_ACCESS_TOKEN
@@ -70,6 +88,12 @@ company-updated:
7088
COMMERCE_CONSUMER_SECRET: $COMMERCE_CONSUMER_SECRET
7189
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
7290
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
91+
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
92+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
93+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
94+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
95+
OAUTH_ORG_ID: $OAUTH_ORG_ID
96+
OAUTH_SCOPES: $OAUTH_SCOPES
7397
annotations:
7498
require-adobe-auth: true
7599
final: true

actions/customer/external/actions.config.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
consumer:
22
function: consumer/index.js
33
web: 'no'
4-
runtime: nodejs:20
4+
runtime: nodejs:22
55
inputs:
66
LOG_LEVEL: debug
77
annotations:
@@ -10,7 +10,7 @@ consumer:
1010
updated:
1111
function: updated/index.js
1212
web: 'no'
13-
runtime: nodejs:20
13+
runtime: nodejs:22
1414
inputs:
1515
LOG_LEVEL: debug
1616
COMMERCE_BASE_URL: $COMMERCE_BASE_URL
@@ -19,13 +19,19 @@ updated:
1919
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
2020
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
2121
COMMERCE_HUBSPOT_CONTACT_ID_FIELD: $COMMERCE_HUBSPOT_CONTACT_ID_FIELD
22+
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
23+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
24+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
25+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
26+
OAUTH_ORG_ID: $OAUTH_ORG_ID
27+
OAUTH_SCOPES: $OAUTH_SCOPES
2228
annotations:
2329
require-adobe-auth: true
2430
final: true
2531
batch:
2632
function: batch/index.js
2733
web: 'no'
28-
runtime: nodejs:20
34+
runtime: nodejs:22
2935
inputs:
3036
LOG_LEVEL: debug
3137
COMMERCE_BASE_URL: $COMMERCE_BASE_URL
@@ -34,13 +40,19 @@ batch:
3440
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
3541
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
3642
COMMERCE_HUBSPOT_CONTACT_ID_FIELD: $COMMERCE_HUBSPOT_CONTACT_ID_FIELD
43+
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
44+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
45+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
46+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
47+
OAUTH_ORG_ID: $OAUTH_ORG_ID
48+
OAUTH_SCOPES: $OAUTH_SCOPES
3749
annotations:
3850
require-adobe-auth: true
3951
final: true
4052
full-import:
4153
function: full-import/index.js
4254
web: 'yes'
43-
runtime: nodejs:20
55+
runtime: nodejs:22
4456
inputs:
4557
LOG_LEVEL: debug
4658
OAUTH_ORG_ID: $OAUTH_ORG_ID
@@ -56,6 +68,7 @@ full-import:
5668
HUBSPOT_ACCESS_TOKEN: $HUBSPOT_ACCESS_TOKEN
5769
HUBSPOT_FULL_IMPORT_CONTACT_GROUP_ID: $HUBSPOT_FULL_IMPORT_CONTACT_GROUP_ID
5870
HUBSPOT_FULL_IMPORT_CONTACT_WEBSITE: $HUBSPOT_FULL_IMPORT_CONTACT_WEBSITE
71+
OAUTH_SCOPES: $OAUTH_SCOPES
5972
annotations:
6073
require-adobe-auth: true
6174
final: true

actions/order/commerce/actions.config.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
consumer:
22
function: consumer/index.js
33
web: 'no'
4-
runtime: nodejs:20
4+
runtime: nodejs:22
55
inputs:
66
LOG_LEVEL: debug
77
annotations:
@@ -10,7 +10,7 @@ consumer:
1010
created:
1111
function: created/index.js
1212
web: 'no'
13-
runtime: nodejs:20
13+
runtime: nodejs:22
1414
inputs:
1515
LOG_LEVEL: debug
1616
HUBSPOT_ACCESS_TOKEN: $HUBSPOT_ACCESS_TOKEN
@@ -20,6 +20,12 @@ created:
2020
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
2121
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
2222
COMMERCE_HUBSPOT_CONTACT_ID_FIELD: $COMMERCE_HUBSPOT_CONTACT_ID_FIELD
23+
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
24+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
25+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
26+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
27+
OAUTH_ORG_ID: $OAUTH_ORG_ID
28+
OAUTH_SCOPES: $OAUTH_SCOPES
2329
annotations:
2430
require-adobe-auth: true
2531
final: true

actions/order/external/actions.config.yaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
consumer:
22
function: consumer/index.js
33
web: 'no'
4-
runtime: nodejs:20
4+
runtime: nodejs:22
55
inputs:
66
LOG_LEVEL: debug
77
annotations:
@@ -10,7 +10,7 @@ consumer:
1010
shipment-created:
1111
function: shipment-created/index.js
1212
web: 'no'
13-
runtime: nodejs:20
13+
runtime: nodejs:22
1414
inputs:
1515
LOG_LEVEL: debug
1616
COMMERCE_BASE_URL: $COMMERCE_BASE_URL
@@ -19,7 +19,10 @@ shipment-created:
1919
COMMERCE_ACCESS_TOKEN: $COMMERCE_ACCESS_TOKEN
2020
COMMERCE_ACCESS_TOKEN_SECRET: $COMMERCE_ACCESS_TOKEN_SECRET
2121
OAUTH_CLIENT_ID: $OAUTH_CLIENT_ID
22-
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
22+
OAUTH_CLIENT_SECRET: $OAUTH_CLIENT_SECRET
23+
OAUTH_TECHNICAL_ACCOUNT_ID: $OAUTH_TECHNICAL_ACCOUNT_ID
24+
OAUTH_TECHNICAL_ACCOUNT_EMAIL: $OAUTH_TECHNICAL_ACCOUNT_EMAIL
25+
OAUTH_ORG_ID: $OAUTH_ORG_ID
2326
OAUTH_SCOPES: $OAUTH_SCOPES
2427
annotations:
2528
require-adobe-auth: true

app.config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ extensions:
1515
info:
1616
function: actions/starter-kit-info/index.js
1717
web: 'yes'
18-
runtime: nodejs:20
18+
runtime: nodejs:22
1919
inputs:
2020
LOG_LEVEL: debug
2121
annotations:
@@ -43,7 +43,7 @@ extensions:
4343
registration:
4444
function: actions/registration/index.js
4545
web: 'yes'
46-
runtime: 'nodejs:18'
46+
runtime: 'nodejs:22'
4747
inputs:
4848
LOG_LEVEL: debug
4949
annotations:
@@ -55,7 +55,7 @@ extensions:
5555
get-order-grid-columns:
5656
function: actions/commerce-ui/orderGridColumns.js
5757
web: 'yes'
58-
runtime: 'nodejs:16'
58+
runtime: 'nodejs:22'
5959
inputs:
6060
LOG_LEVEL: debug
6161
annotations:
-37.8 KB
Loading
-43.4 KB
Loading

env.dist

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,26 @@ OAUTH_BASE_URL=https://ims-na1.adobelogin.com/ims/token/
22
IO_MANAGEMENT_BASE_URL=https://api.adobe.io/events/
33

44
# OAuth configs
5+
# Values required for Adobe Commerce SaaS Rest Authorization.
6+
57
# The following values can be copied from the Credential details page in AppBuilder under Organization > Project > Workspace > OAuth Server-to-Server
8+
# Client ID
69
OAUTH_CLIENT_ID=
10+
# Client Secret (Retrieve Client Secret)
711
OAUTH_CLIENT_SECRET=
12+
# Technical Account ID
813
OAUTH_TECHNICAL_ACCOUNT_ID=
14+
# Technical Account Email
915
OAUTH_TECHNICAL_ACCOUNT_EMAIL=
16+
# Organization ID
1017
OAUTH_ORG_ID=
1118
OAUTH_SCOPES=AdobeID, openid, read_organizations, additional_info.projectedProductContext, additional_info.roles, adobeio_api, read_client_secret, manage_client_secrets, event_receiver_api
1219

13-
# Commerce OAuth configs
20+
# Commerce OAuth configs. PaaS Only. Required for authorization of Adobe Commerce Rest Apis.
1421
# These values can be copied from the Integration Details under System > Integrations
15-
# Commerce base URL should finish with slash '/'
22+
# Commerce base URL should finish with slash '/'. Example: https://adobe.commerce/rest/
1623
COMMERCE_BASE_URL=
24+
# Select Integration you created and copy values from "Integration Details"
1725
COMMERCE_CONSUMER_KEY=
1826
COMMERCE_CONSUMER_SECRET=
1927
COMMERCE_ACCESS_TOKEN=
@@ -23,6 +31,8 @@ COMMERCE_ACCESS_TOKEN_SECRET=
2331
# These values will be used to configure the Adobe I/O Events module automatically
2432
# that can be found at Stores > Configuration > Adobe Services > Adobe I/O Events
2533
COMMERCE_ADOBE_IO_EVENTS_MERCHANT_ID=
34+
# Default value is Stage. You can change it for your usecases if needed.
35+
COMMERCE_ADOBE_IO_EVENTS_ENVIRONMENT_ID=Stage
2636

2737
# Workspace configs
2838
# The following values can be copied from the JSON downloadable in AppBuilder from Organization > Project > Workspace
@@ -37,9 +47,13 @@ IO_WORKSPACE_ID=
3747
# To retrieve that value go to Account Management > Integrations > Private app and Access token section
3848
HUBSPOT_ACCESS_TOKEN=
3949

50+
# Adobe Commerce customer custom attribute code, which will be used to save Hubspot Customer ID, so in case if customer already being exported to Hubspot, system will perform Update and not Create action
4051
COMMERCE_HUBSPOT_CONTACT_ID_FIELD=
4152

4253
#HUBSPOT CONTACT FULL IMPORT CONFIG, related with the runtime action customer-backoffice/full-import
54+
# Adobe Commerce Group ID for customers. (1 - General Group)
4355
HUBSPOT_FULL_IMPORT_CONTACT_GROUP_ID=
56+
57+
# Adobe Commerce Website Code to import
4458
HUBSPOT_FULL_IMPORT_CONTACT_WEBSITE=
4559

0 commit comments

Comments
 (0)