App Composition Platform installation
Edit on GitHubThis document describes how you can make your project ACP-ready and how you install ACP.
Installing ACP in SCCOS
To be eligible for ACP, your project must be hosted in the Spryker Cloud.
The ACP catalog is integrated into the Back Office and contains the list of applications you can connect to your shop.
You can access the ACP catalog only if you are a SCCOS customer and have been enabled for ACP. This means that your SCCOS environment needs to be properly set up and registered with ACP.
The installation process of ACP on SCCOS is also called ACP enablement. It involves multiple steps that require actions from both you and Spryker. The first step implies making your SCCOS project ACP-ready, meaning that the required ACP modules are up-to-date and the SCCOS Cloud environment is configured correctly. The second step is making your project ACP-enabled by registering your SCCOS project with the Spryker’s ACP. This enables the ACP Catalog in the Back Office to interact with ACP, allowing you to browse, connect, and configure ACP applications for use with SCCOS.
The following diagram illustrates the different steps of the ACP enablement process and outlines the responsibilities for executing them.
The actions and level of effort required to make your project ACP-ready may vary depending on the update status of your SCCOS module versions. However, the process of making your project ACP-enabled is always handled by Spryker.
Getting SCCOS ACP-ready
To make your project ACP-ready, different update steps are necessary depending on the template version on which your project was started:
- SCCOS product release 202211.0: All the changes required for ACP readiness are already included, but you should still verify them at the project level.
- Older versions: To get the project ACP-ready, you should complete all steps described in this document.
If you were onboarded with a version older than product release 202211.0, please contact us.
Module updates for ACP
To get your project ACP-ready, it is important to ensure that your project modules are updated to the necessary versions.
ACP modules
Starting with the Spryker product release 202211.0, the ACP catalog is included by default in the Spryker Cloud product. However, you should still make sure that your Spryker project uses the latest versions of the following modules:
spryker/app-catalog-gui: ^1.2.0
or laterspryker/message-broker:^1.4.0
or laterspryker/message-broker-aws:^1.3.2
or laterspryker/session:^4.15.1
or later
App modules
Depending on the specific ACP apps or PBCs you intend to use through ACP, you will need to add or update the modules for each respective app or PBC as explained in the corresponding app guide.
The Spryker ACP Apps are continuously enhanced and improved with new versions. Though you don’t have to update the apps themselves, it might be at times necessary to perform minor updates of the app-related SCCOS modules to take full advantage of the latest app feature updates.
For each app you wish to use, ensure that you have the latest app-related SCOS modules installed. You can find this information in each App integration guide.
Configure SCCOS
If your version is based on product release 202211.0 or newer, you can skip this section!
Once you have ensured that your project modules are up-to-date, proceed to configure your SCCOS project to activate the ACP catalog in the Back Office using the following steps:
- Define the configuration and add plugins to the following files:
config/Shared/config_default.php
use Spryker\Shared\AppCatalogGui\AppCatalogGuiConstants;
use Spryker\Shared\Kernel\KernelConstants;
use Spryker\Shared\MessageBroker\MessageBrokerConstants;
use Spryker\Shared\MessageBrokerAws\MessageBrokerAwsConstants;
use Spryker\Shared\OauthAuth0\OauthAuth0Constants;
use Spryker\Shared\OauthClient\OauthClientConstants;
use Spryker\Shared\Store\StoreConstants;
use Spryker\Zed\OauthAuth0\OauthAuth0Config;
...
// ----------------------------------------------------------------------------
// ------------------------------ ACP -----------------------------------------
// ----------------------------------------------------------------------------
$aopApplicationConfiguration = json_decode(html_entity_decode((string)getenv('SPRYKER_AOP_APPLICATION')), true);
$config[KernelConstants::DOMAIN_WHITELIST] = array_merge(
$config[KernelConstants::DOMAIN_WHITELIST],
$aopApplicationConfiguration['APP_DOMAINS'] ?? [],
);
$config[StoreConstants::STORE_NAME_REFERENCE_MAP] = $aopApplicationConfiguration['STORE_NAME_REFERENCE_MAP'] ?? [];
$config[AppCatalogGuiConstants::APP_CATALOG_SCRIPT_URL] = $aopApplicationConfiguration['APP_CATALOG_SCRIPT_URL'] ?? '';
$aopAuthenticationConfiguration = json_decode(html_entity_decode((string)getenv('SPRYKER_AOP_AUTHENTICATION')), true);
$config[OauthAuth0Constants::AUTH0_CUSTOM_DOMAIN] = $aopAuthenticationConfiguration['AUTH0_CUSTOM_DOMAIN'] ?? '';
$config[OauthAuth0Constants::AUTH0_CLIENT_ID] = $aopAuthenticationConfiguration['AUTH0_CLIENT_ID'] ?? '';
$config[OauthAuth0Constants::AUTH0_CLIENT_SECRET] = $aopAuthenticationConfiguration['AUTH0_CLIENT_SECRET'] ?? '';
$config[MessageBrokerConstants::CHANNEL_TO_TRANSPORT_MAP] =
$config[MessageBrokerAwsConstants::CHANNEL_TO_RECEIVER_TRANSPORT_MAP] = [
// Here we will define the receiver transport map accordinally to APP (PBC)
];
$config[MessageBrokerAwsConstants::CHANNEL_TO_SENDER_TRANSPORT_MAP] = [
// Here we will define the sender transport map accordinally to APP (PBC)
];
$aopInfrastructureConfiguration = json_decode(html_entity_decode((string)getenv('SPRYKER_AOP_INFRASTRUCTURE')), true);
$config[MessageBrokerAwsConstants::SQS_RECEIVER_CONFIG] = json_encode($aopInfrastructureConfiguration['SPRYKER_MESSAGE_BROKER_SQS_RECEIVER_CONFIG'] ?? []);
$config[MessageBrokerAwsConstants::HTTP_SENDER_CONFIG] = $aopInfrastructureConfiguration['SPRYKER_MESSAGE_BROKER_HTTP_SENDER_CONFIG'] ?? [];
// ----------------------------------------------------------------------------
// ------------------------------ OAUTH ---------------------------------------
// ----------------------------------------------------------------------------
$config[OauthClientConstants::OAUTH_PROVIDER_NAME_FOR_MESSAGE_BROKER] = OauthAuth0Config::PROVIDER_NAME;
$config[OauthClientConstants::OAUTH_GRANT_TYPE_FOR_MESSAGE_BROKER] = OauthAuth0Config::GRANT_TYPE_CLIENT_CREDENTIALS;
$config[OauthClientConstants::OAUTH_OPTION_AUDIENCE_FOR_MESSAGE_BROKER] = 'aop-event-platform';
$config[AppCatalogGuiConstants::OAUTH_PROVIDER_NAME] = OauthAuth0Config::PROVIDER_NAME;
$config[AppCatalogGuiConstants::OAUTH_GRANT_TYPE] = OauthAuth0Config::GRANT_TYPE_CLIENT_CREDENTIALS;
$config[AppCatalogGuiConstants::OAUTH_OPTION_AUDIENCE] = 'aop-atrs';
$config[OauthClientConstants::OAUTH_PROVIDER_NAME_FOR_PAYMENT_AUTHORIZE] = OauthAuth0Config::PROVIDER_NAME;
$config[OauthClientConstants::OAUTH_GRANT_TYPE_FOR_PAYMENT_AUTHORIZE] = OauthAuth0Config::GRANT_TYPE_CLIENT_CREDENTIALS;
$config[OauthClientConstants::OAUTH_OPTION_AUDIENCE_FOR_PAYMENT_AUTHORIZE] = 'aop-app';
- In the
navigation.xml
file, add one more navigation item:
...
<app-catalog-gui>
<label>Apps</label>
<title>Apps</title>
<icon>fa-cubes</icon>
<bundle>app-catalog-gui</bundle>
<controller>index</controller>
<action>index</action>
</app-catalog-gui>
...
- In the
MessageBrokerDependencyProvider.php
file, enable the following module plugins:
src/Pyz/Zed/MessageBroker/MessageBrokerDependencyProvider.php
<?php
/**
* This file is part of the Spryker Suite.
* For full license information, please view the LICENSE file that was distributed with this source code.
*/
namespace Pyz\Zed\MessageBroker;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\CorrelationIdMessageAttributeProviderPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\TimestampMessageAttributeProviderPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\TransactionIdMessageAttributeProviderPlugin;
use Spryker\Zed\MessageBroker\Communication\Plugin\MessageBroker\ValidationMiddlewarePlugin;
use Spryker\Zed\MessageBroker\MessageBrokerDependencyProvider as SprykerMessageBrokerDependencyProvider;
use Spryker\Zed\MessageBrokerAws\Communication\Plugin\MessageBroker\Receiver\AwsSqsMessageReceiverPlugin;
use Spryker\Zed\MessageBrokerAws\Communication\Plugin\MessageBroker\Sender\HttpMessageSenderPlugin;
use Spryker\Zed\OauthClient\Communication\Plugin\MessageBroker\AccessTokenMessageAttributeProviderPlugin;
use Spryker\Zed\Session\Communication\Plugin\MessageBroker\SessionTrackingIdMessageAttributeProviderPlugin;
use Spryker\Zed\Store\Communication\Plugin\MessageBroker\CurrentStoreReferenceMessageAttributeProviderPlugin;
use Spryker\Zed\Store\Communication\Plugin\MessageBroker\StoreReferenceMessageValidatorPlugin;
class MessageBrokerDependencyProvider extends SprykerMessageBrokerDependencyProvider
{
/**
* @return array<\Spryker\Zed\MessageBrokerExtension\Dependency\Plugin\MessageSenderPluginInterface>
*/
public function getMessageSenderPlugins(): array
{
return [
new HttpMessageSenderPlugin(),
];
}
/**
* @return array<\Spryker\Zed\MessageBrokerExtension\Dependency\Plugin\MessageReceiverPluginInterface>
*/
public function getMessageReceiverPlugins(): array
{
return [
new AwsSqsMessageReceiverPlugin(),
];
}
/**
* @return array<\Spryker\Zed\MessageBrokerExtension\Dependency\Plugin\MessageAttributeProviderPluginInterface>
*/
public function getMessageAttributeProviderPlugins(): array
{
return [
new CorrelationIdMessageAttributeProviderPlugin(),
new TimestampMessageAttributeProviderPlugin(),
new CurrentStoreReferenceMessageAttributeProviderPlugin(),
new AccessTokenMessageAttributeProviderPlugin(),
new TransactionIdMessageAttributeProviderPlugin(),
new SessionTrackingIdMessageAttributeProviderPlugin(),
];
}
/**
* @return array<\Spryker\Zed\MessageBrokerExtension\Dependency\Plugin\MiddlewarePluginInterface>
*/
public function getMiddlewarePlugins(): array
{
return [
new ValidationMiddlewarePlugin(),
];
}
/**
* @return array<\Spryker\Zed\MessageBrokerExtension\Dependency\Plugin\MessageValidatorPluginInterface>
*/
public function getExternalValidatorPlugins(): array
{
return [
new StoreReferenceMessageValidatorPlugin(),
];
}
}
- In the
MessageBrokerConfig.php
file, adjust the following module config:
src/Pyz/Zed/MessageBroker/MessageBrokerConfig.php:
<?php
/**
* This file is part of the Spryker Suite.
* For full license information, please view the LICENSE file that was distributed with this source code.
*/
namespace Pyz\Zed\MessageBroker;
use Generated\Shared\Transfer\MessageAttributesTransfer;
use Spryker\Zed\MessageBroker\MessageBrokerConfig as SprykerMessageBrokerConfig;
class MessageBrokerConfig extends SprykerMessageBrokerConfig
{
/**
* Defines attributes which should not be logged.
*
* @api
*
* @return array<string>
*/
public function getProtectedMessageAttributes(): array
{
return [
MessageAttributesTransfer::AUTHORIZATION,
];
}
}
- In the
OauthClientDependencyProvider.php
file, enable the following module plugins:
In the MessageBrokerConfig.php, adjust the following module config:
src/Pyz/Zed/OauthClient/OauthClientDependencyProvider.php
<?php
/**
* This file is part of the Spryker Suite.
* For full license information, please view the LICENSE file that was distributed with this source code.
*/
namespace Pyz\Zed\OauthClient;
use Spryker\Zed\OauthAuth0\Communication\Plugin\OauthClient\Auth0OauthAccessTokenProviderPlugin;
use Spryker\Zed\OauthClient\OauthClientDependencyProvider as SprykerOauthClientDependencyProvider;
use Spryker\Zed\Store\Communication\Plugin\OauthClient\CurrentStoreReferenceAccessTokenRequestExpanderPlugin;
class OauthClientDependencyProvider extends SprykerOauthClientDependencyProvider
{
/**
* @return array<\Spryker\Zed\OauthClientExtension\Dependency\Plugin\OauthAccessTokenProviderPluginInterface>
*/
protected function getOauthAccessTokenProviderPlugins(): array
{
return [
new Auth0OauthAccessTokenProviderPlugin(),
];
}
/**
* @return array<\Spryker\Zed\OauthClientExtension\Dependency\Plugin\AccessTokenRequestExpanderPluginInterface>
*/
protected function getAccessTokenRequestExpanderPlugins(): array
{
return [
new CurrentStoreReferenceAccessTokenRequestExpanderPlugin(),
];
}
}
3. Update the SCCOS deploy.yml file
This section describes the variables that you must configure for use within your SCCOS AWS environment.
You need to define the environment variables in the deploy.yml
file of each SCCOS environment like testing, staging, and production. There will be multiple general environment variables that in turn will contain several configurations.
It is crucial to specify the keys for the environment variables. The infrastructure values, such as SPRYKER_AOP_INFRASTRUCTURE
and STORE_NAME_REFERENCE_MAP
, are provided by Spryker OPS upon request.
General structure:
ENVIRONMENT_VARIABLE_NAME_A: '{
"CONFIGURATION_KEY_A":"SOME_VALUE_A",
"CONFIGURATION_KEY_B":"SOME_VALUE_B"
}'
Data structure example for a demo environment connected to the Spryker ACP production:
#AOP
SPRYKER_AOP_APPLICATION: '{
"APP_CATALOG_SCRIPT_URL": "https://app-catalog.atrs.spryker.com/loader",
"STORE_NAME_REFERENCE_MAP": {"DE": "tenant_messages_for_store_reference_AOP_Demo_Production-DE.fifo", "AT": "tenant_messages_for_store_reference_AOP_Demo_Production-AT.fifo"},
"APP_DOMAINS": [
"os.apps.aop.spryker.com",
"*.bazaarvoice.com"
]
}'
SPRYKER_AOP_INFRASTRUCTURE: '{
"SPRYKER_MESSAGE_BROKER_HTTP_SENDER_CONFIG": {
"endpoint":"https:\/\/events.atrs.spryker.com\/events\/tenant"
},
"SPRYKER_MESSAGE_BROKER_SQS_RECEIVER_CONFIG": {
"default": {
"endpoint":"https:\/\/sqs.eu-central-1.amazonaws.com",
"region":"eu-central-1",
"auto_setup":false,
"buffer_size":1
},
"DE": {
"queue_name":"tenant_messages_for_store_reference_AOP_Demo_Production-DE.fifo"
},
"AT": {
"queue_name":"tenant_messages_for_store_reference_AOP_Demo_Production-AT.fifo"
}
}
}'
General configurations: SPRYKER_AOP_APPLICATION variable
The configuration key APP_CATALOG_SCRIPT_URL
is a URL for the App-Tenant-Registry-Service (ATRS) and the path to the JS script to load the ACP catalog.
Example of the production ATRS_HOST and path:
https://app-catalog.atrs.spryker.com/loader
The configuration key: STORE_NAME_REFERENCE_MAP
is the StoreReference mapping to the appropriate Spryker store.
The StoreReference mapping is created by Spryker OPS, and they provide you with the corresponding values to be added to your deploy.yml file.
Example of demo stores for DE and AT:
{"DE": "tenant_messages_for_store_reference_AOP_Demo_Production-DE", "AT": "tenant_messages_for_store_reference_AOP_Demo_Production-AT"}
The configuration key APP_DOMAINS
designates the app domains used in redirects.
The app domains are provided by Spryker OPS.
Example of the app domain values:
[
"os.apps.aop.spryker.com",
"*.bazaarvoice.com"
]
Message Broker configuration: SPRYKER_AOP_INFRASTRUCTURE variable
The configuration key SPRYKER_MESSAGE_BROKER_SQS_RECEIVER_CONFIG
is for the receiver configuration. The queues must be defined for each store, or a default queue for all stores is to be defined.
The queues are created by Spryker OPS, and they provide you with the corresponding values to be added to your deploy.yml file.
Example of the receiver configuration for the Spryker production environment:
{
"default": {
"endpoint":"https://sqs.eu-central-1.amazonaws.com",
"auto_setup":false, "buffer_size":1
},
"DE": {
"queue_name":"tenant_messages_for_store_reference_AOP_Demo_Production-DE.fifo"
},
"<Store Reference>": {
"queue_name":"queue_name_for_store_reference_<Store>"
}
}
Example of the SPRYKER_MESSAGE_BROKER_HTTP_SENDER_CONFIG
configuration key value:
{
"endpoint":"https://events.atrs.spryker.com/events/tenant"
}
Next steps after the ACP-readiness
After configuring the files, updating all modules, and adding the requested keys with their corresponding values provided by Spryker OPS to the deploy.yml
file, the SCCOS codebase is now up-to-date. Once redeployed, your environment is ACP-ready.
The next step is to get your newly updated and deployed ACP-ready SCCOS environment ACP-enabled. The ACP enablement step is fully handled by Spryker and implies the registration of your ACP-ready SCCOS environment with ACP by connecting it with the ACP App-Tenant-Registry-Service (ATRS) as well as the Event Platform (EP) so that the ACP catalog is able to work with SCCOS.
To get your project ACP-enabled, contact the Spryker support.
Once all the steps of the ACP-enablement process are completed, the ACP catalog appears in the Back Office:
Thank you!
For submitting the form