Learn about the concepts and terminology of Connect.
What is Connect
Connect lets you add functionality to your Composable Commerce Project without needing to buy and maintain dedicated hosting or runtime environments.
Who is Connect for
Connect provides advantages to creators (application developers) and clients (Composable Commerce customers).
Creators can develop public or private applications using JavaScript/TypeScript or Java, and enjoy a simplified development and publishing process.
Clients can deploy applications without needing to manage hosting or runtime environments.
Connect workflow
The following diagram and steps provide a complete overview of creating and deploying a Connector.
- Create Connect applications using JavaScript/TypeScript or Java.
- Save the source code of these Connect applications in a GitHub repository.
- When ready to test or deploy your Connect applications, create a release in the GitHub repository with a Git tag.
- If your repository is private, you must grant read access to the connect-mu machine user.
- Create or update your Connector.
- Create and deploy a preview build.
- Publish a production build.
Key concepts of Connect
The following sections explain the key concepts and terminology of Connect.
Connect applications
Connect applications can be of the following types:
| Type | Description | Example use case |
|---|---|---|
| Service | Perform actions using API Extensions or webhooks. | Validate the contents of carts. |
| Event | Receive events and perform actions asynchronously using Subscriptions. | Send order confirmation emails. |
| Job | Perform scheduled tasks using cron expressions. | Run daily maintenance, updates, or syncs with external systems. |
| merchant-center-custom-application | Extend the Merchant Center with Custom Applications. | Provide a frontend for modifying the emails sent by the event application. |
| merchant-center-custom-view | Add custom functionality to a specific Merchant Center page using Custom Views. | Add custom functionality in the context of a specific page within a built-in Merchant Center application. |
| Assets | Host static assets with CDN capabilities. | Host static assets used by the other applications. |
GitHub repository
connect.yaml file in the root. connect.yaml contains the configuration details of the Connect applications, including defining environment variables used by the applications. You can view the example structure of a GitHub repository in the Connect Application Starter in JavaScript.Connectors
In the Connect API, Connectors have two representations:
- ConnectorStaged: used to create, update, and preview Connectors before submitting them for publishing.
- Connector: a read-only model that represents a published and deployable Connector.
Create and update Connectors
Depending on if you are using the Connect API or Merchant Center, the process of creating and updating Connectors is different.
Connect API
Merchant Center
If you are creating a new Connector:
- Create a ConnectorStagedDraft that references your GitHub repository and Git tag.
- Post the ConnectorStagedDraft to the Create ConnectorStaged endpoint. This creates a ConnectorStaged that you can preview and publish.
If you are updating an existing Connector:
- Push your code changes to the GitHub repository and create a release with a Git tag.
- Update the ConnectorStaged using the Set Repository update action to reference the new Git tag.
Create and deploy a preview build
Preview builds allow you to test the functionality of your Connect applications before publishing the Connector.
Depending on whether you are using the Connect API or Merchant Center, the process of requesting and deploying a preview build is different.
Connect API
Merchant Center
- Request the previewable status of the ConnectorStaged using the Preview Connector update action.
- The system reviews your ConnectorStaged before it becomes previewable. To check the previewable status of your ConnectorStaged, query the Get ConnectorStaged endpoint and check the
isPreviewablefield. - If the
isPreviewablefield of your ConnectorStaged istrue, the preview is successful and you can continue to step 2. Iffalse, fix any issues in your Connect applications, update the ConnectorStaged if needed (for example by using the Set Repository update action), and repeat this step untilisPreviewableistrue.
- The system reviews your ConnectorStaged before it becomes previewable. To check the previewable status of your ConnectorStaged, query the Get ConnectorStaged endpoint and check the
- Create a DeploymentDraft that includes a reference to the ConnectorStaged.
connector.stagedmust be set totrueto deploy a previewable ConnectorStaged. - Post the DeploymentDraft to the Create Deployment endpoint. This creates a Deployment that includes a reference to the ConnectorStaged.
Publish a production build
Connectors must be published before they can be deployed.
Depending on if you are using the Connect API or Merchant Center, the process of publishing Connectors is different.
Connect API
Merchant Center
- If the Connector is intended for private use only, update the ConnectorStaged using the publish update action with
certificationset tofalse. - Create a DeploymentDraft that includes a reference to the Connector.
- Post the DeploymentDraft to the Create Deployment endpoint.
- This creates a Deployment that includes a reference to the Connector.
Validation process
connect.yaml file is also validated. These checks help ensure that Connect applications meet the required standards for running in a production environment.commercetools connect validate CLI command.You can check the validation status of a preview build or published Connector using the Connect API or Merchant Center.
Connect API
Merchant Center
- Query the Get ConnectorStaged endpoint of the ConnectorStaged.
- Check the
previewableReportorpublishingReportfields of the ConnectorStaged.- The
isPreviewablefield indicates if the ConnectorStaged has passed validation for the preview build. - If the
statusfield isPublished, the ConnectorStaged has passed validation for publishing.
- The
Certification process
If you are creating a Connector for private use only, then certification is not required.
Deployments
Connectors that use third-party services may require that you have a commercial contract with the service provider before deploying the Connector.
Deployment information and limitations
Service
- Uses HTTP-based exposed endpoints.
- Application request times out after 5 minutes.
- Will autoscale based on the number of requests.
Event
- Uses a message broker service.
- The event acknowledgment timeout for an application is 10 seconds.
- Application request times out after 5 minutes.
- The delivery promise is at-least-once delivery with no ordering guarantees.
- The message queue discards a message from a Subscription as soon as the message is acknowledged.
- Unacknowledged messages are retained for 7 days.
- The message queue will retry the message if the application responds with any other response code than
102,200,201,202, or204.- Push backoff applies if the application responds with too many negative acknowledgments.
- Will autoscale based on the number of events being processed.
Job
- Uses a cron-based scheduler service.
- Application request times out after 30 minutes.
Merchant-center-custom-application
- Is a hosted React application.
- Application request times out after 5 minutes.
- Will autoscale based on the number of requests.
Merchant-center-custom-view
- Is a hosted React application.
- The server times out after 5 minutes.
- Will autoscale based on the number of requests.
Assets
- Hosts static assets.
- Application request times out after 5 minutes.
- CDN capabilities are supported.
Environments
sandbox environment by default if no other type is specified. These deployments automatically scale down to zero when they are unused for a while. This can cause timeouts because they require approximately 15 seconds to boot up again.Sandbox
sandbox deployment type is the default deployment type for Connectors. It allows you to run your Connector in a non-production environment, such as a development or QA environment.You cannot deploy a ConnectorStaged to a sandbox environment.
Preview
preview deployment type lets you test your ConnectorStaged during application development. It allows you to validate your logic and make sure the functionality works as expected.isPreviewable status to true for preview deployments.Preview deployments should be deleted as soon as testing is complete. They are only intended to last a short time and scale down to zero.
Production
production deployment type lets you deploy a Connector, which is already in production or is ready to be in your production environment. Only published Connectors can use the production deployment type.production provides the highest scalability for optimal performance and stability of the Connector, with already warmed-up instances ready to manage the load at all times.production, contact your Customer Success Manager or the Connect support team for assistance.