27 June, 2024

Sitecore Commerce - How do we trigger minion on-demand using postman?

While Composable Commerce is gaining traction, Sitecore Experience Commerce (XC) is still being used by many Sitecore customers. In this article, we will talk about Sitecore Experience Commerce Minions. Minions Role is an instance of the Commerce Engine that runs independently and supports asynchronous processing.

Based on business requirements, minions can be created and it can be scheduled to run at the appropriate time using cronjobs. Sometimes it needs to be triggered manually. We can use postman to initiate it. 

In order to run the minions, we need to get access token by hitting the /connect/token endpoint of Identity server. Using it, you can send a request to RunMinon() API with the Minion Full Name and you can see the status in the logs. 


Get the access token by sending the request to token endpoint of ID server.

Trigger Minion

In order to trigger the minion, you need the minion full name. Once posted, it will start the job in the background and you can see the status in the log file. 

20 March, 2024

Hosting Sitecore XM Cloud Next.js frontend app in AWS Amplify

Next.js's creator, Vercel, is the preferred hosting solution. However, many other hosting providers have recently begun to support hosting frontend apps and various features of Next.js. One of them is Amazon Web Service (AWS) Amplify. 

AWS Amplify, backed by robust AWS infrastructure, is a hosting service provided by Amazon Web Service. You can host the frontend application like Next.js app or you can do full stack development using their Amplify Studio. AWS Amplify supports many features of Next.js but it lacks support on Edge API Routes (Edge middleware is not supported), On-Demand Incremental Static Regeneration (ISR), Internationalized (i18n) automatic locale detection, Next.js streaming, Running middleware on static assets and optimized images. You can refer this page for any updates on the Next.js feature support. 

To use AWS Amplify as the hosting provider, you can either use your existing subscription or sign up for trial AWS account which gives free access to some of their service for 12 months. 

Hosting XM Cloud Foundation Head

  1. An XM Cloud project has been setup and Foundation template repository is cloned in your source control. 
  2. Sign in to the AWS Management Console and open the Amplify console. 

  3. In the AWS Amplify home page, click Get Started if you are using it for the first time.  

  4. Click Get Started in Amplify Hosting. 

  5. Select the source code location. In my case, it is GitHub. You will have to authorize Amplify to read/write your repository.  

  6. Once the permission is set, you can choose the repository, branch and also check Connecting a monorepo and set the path as srx/sxastarter as the Next.js application is placed in that folder. 

  7. When you click Next, you will see the build settings. You can see the build commands, app root folder and the artifacts base directory as well. 

  8. Set the Sitecore related environment variables. You can get the SITECORE_EDGE_CONTEXT_ID from XM Cloud Deploy App --> Environment --> Details (Context ID (Live)).

  9. Review the changes and click "Save and Deploy"

  10. It will provision the environment, build and deploy it. You will get the AWS Amplify domain name at the end. https://*

  11. When browsing the site, you can see the content but it will be missing the styles. When checking the network tab, you can see the domain name for the static files as http://localhost:3000. 

  12. You can go ahead and add an environment variable called PUBLIC_URL and add the newly generated URL including protocol. 

  13. Now, your site will load perfectly with all the styles. 

PUBLIC_URL Environment Variable

The URLs which are generated for the static files depends on the domain name set by the hosting provider or the PUBLIC_URL Environment variable. PUBLIC_URL environment variable has higher precedence than any other environment variable. If it is not set, then it fall back to the hosting provider environment variable. 

Hosting providers like Vercel and Netlify provide the unique deployment URL in the system defined Environment variable by default. 



For AWS Amplify, as of now, the feature is not available and an issue is open in GitHub. The format of the Amplify URL is https://{branchName}.{AmplifyAppID} There are few ways to generate the URLs and I will discuss it in another post. 

To check how Sitecore Next.js SDK consume these URLs, please refer this Utils file in GitHub

Happy Learning!

14 March, 2024

Vercel Edge Config for Sitecore Projects

Vercel has a key-value storage option, Edge Config, for ultra-fast read to handle quick logic at the edge. 

As of now, Vercel has 4 different storage options. 

ProductKVPostgresBlobEdge Config
DetailsDurable RedisServerless SQLLarge file storageGlobal, low-latency data store
Reads/WritesFast/msFast/msFast/msUltra-fast (~5ms - ~15ms) /s
Use CaseKey/value and JSON dataStructured, relational dataLarge, content-addressable files ("blobs")Runtime configuration (e.g., feature flags)


  • Incredibly fast to read. Lookups return in 5 ms or less, and 99% of reads will return under 15 ms.
  • Do not need to perform a deployment.
  • Global, available in all regions

Use Cases

  • Feature flags and A/B testing
  • Enabling maintenance pages or critical redirects
  • Malicious IP and User Agent blocking


  • Should not be used as a general-purpose key/value store. Use KV instead. 
  • Cost is mostly depends on the reads as the primary use case of Edge Config is reading data at the edge. Number of writes also matters in overall pricing. 
  • Important to note that the maximum store size of all the key value data is 64KB. So it is limited to only critical data which needs to be in edge for quicker read. 
  • Takes 10 seconds to propagate the changes in key-value data to global regions. 
  • There are costs and limits to the number of reads and writes per plan so I would recommend using it when there is a feature release, soft launching a feature to a limited group or similar tasks. Once done, it should be removed to avoid any charges. 

Edge Config SDK and API

  • Edge Config connection string should be added in the environment variable with key EDGE_CONFIG. By default, SDK reads the connecting string from the environment variable. 
  • An SDK to read data from Edge Config API is available. @vercel/edge-config. Install the npm package using 
    • get - Reading a value
    • has - Checking if a key exists
    • getAll - Reading all items or in batches

Use Case 1: Redirect

In case if you have a feature update on certain section of a site and you would like to enable maintenance page and need a way to quickly remove it without any deployment, you can add the flag in the Edge config and use it to rewrite the section of the site to maintenance page using middleware. 

Refer this demo page: Use case 1.

Use Case 2: Feature Flags

In case if a feature should be enabled or disabled with a feature flag, Edge Config can help in changing the response. This should eventually removed once the feature has been permanently enabled to avoid Edge Config read hits. 

Similarly there are many uses cases where the edge data can be used. Another reminder that this edge config is not for regular key-value data as there are restrictions to the size and the number of read/write hits. 

15 February, 2024

Sitecore XM Cloud CLI New Feature - Organization command

Sitecore updated the CLI with additional cloud command. 'organization'. This fits in along with other commands like login, logout, project, environment and deployment

Organization command has three sub commands which helps you to retrieve the organization information, health of the particular organization at that time and retrieve license file. 

In order to quickly update cloud plugin, you can just remove and add it by executing the following in terminal. 

cloud organization info

This sub command helps you to retrieve the currently logged in Organization details. 

cloud organization health

This sub command helps you to display the status of the organization. You can view the health in Sitecore Deploy Portal --> System Health.

cloud organization license

This sub command helps you to download the organization's license. This can be used for your local development. 

07 November, 2023

Sitecore Scheduled Publish Module Enhancements

Sitecore Scheduled Publish Module gives the content author the option to delay the publishing of an item for a future point in time. This module has been updated to Sitecore 10.3 recently. Also, I did update this module with few additional features for better usage. 

  • Set Scheduled Publish Requestor as Publisher

    A content author schedules a publish request. When the scheduler job executes the request at the appropriate time, it publishes the content as the requestor user. This allows Ops teams to track who initiated the request. If you want to track what items are published, you can override the publish:itemProcessed event to log the details.

    With this change, the actual publish request will be executed in the requestor user context. 

  • Alert content authors if the item is not in final workflow state

    The final workflow state is an important part of Sitecore's workflow system. It helps ensure that content items are published in a controlled manner and are not accidentally changed after they are published.

    If an item scheduled for publishing is not in the final workflow state, the publish job will not publish the item or will publish the last approved item version. To remind the content authors, a warning has been added to the dialog that shows whether the item is in the final state. If the item does not have a workflow, this section is hidden. 

  • Set the current time + 2 minutes as default for publish time

    Choosing the date and time when scheduling a publish was an extra step for content authors. With this change, the current date and time plus 2 minutes will be set as the default publish time in the publish time field.

  • Updated to latest Sitecore CLI and Serialization plugin

    Updated to use the latest version of Sitecore CLI (5.2.113 as of 11/07) with Serialization plugin. 

The Sitecore packages (.zip) are yet to be updated in the repository. Please take the latest codebase for the enhancements.  

blockquote { margin: 0; } blockquote p { padding: 15px; background: #eee; border-radius: 5px; } blockquote p::before { content: '\201C'; } blockquote p::after { content: '\201D'; }