Posts

Eight Ways In: A Content Hub Reading Reference

Hello everyone, and welcome to another blog! In this blog, we’ll explore how to consume Sitecore Content Hub data using the Content Hub WebClient SDK, HTTP raw endpoints, and search queries, with a specific focus on scenarios involving external components. Every field you'll meet in Content Hub is one of a handful of shapes — a plain property, an option list, a taxonomy entity, a relation, a count, a search box. Each shape has one or two read methods that actually fit it. Here's how to spot which one you're looking at before you write a query. SDK @sitecore/sc-contenthub-webclient-sdk The SDK gives you several doors into the same data — a typed query engine, a per-entity property/relation loader, an option-list reader, and a raw REST layer underneath all of it. None of them is wrong, exactly, but each is a good fit for exactly one shape of data and an awkward fit for the rest. The fastest way to pick correctly is to look at what you're tryin...

Sitecore Content Hub Bulk Read SDK vs. GraphQL: Performance and Use Cases

Sooner or later every Sitecore Content Hub project gets a request like this: "Can you give us a spreadsheet of every usage right, with its status and expiry dates?" or "Find all assets whose rights expired more than six months ago." In other words, you have to read every entity of one definition . That can be tens of thousands of records, and you need them reliably, without duplicates or gaps. I recently built exactly this for the M.DRM.RightsProfile definition, which holds usage rights. There are two very different APIs for it, and the SDK itself offers two ways to page: The Content Hub Web SDK ( Stylelabs.M.Sdk.WebClient ), using either SearchAfterQuery or the Entity Scroller . Sitecore Experience Edge GraphQL , which can return up to 1,000 records per call . I put both behind a single switch in the same helper, so they write an identical CSV and I could time them against each other. This post covers how each approach works, the traps I hit...

Update One Field Not the Whole Entity: Safe Backfills in Sitecore Content Hub

Image
Hello everyone, and welcome to another blog post! In this blog, we’ll explore an important aspect of saving entities in Sitecore Content Hub, particularly during large-scale data update operations such as **backfill activities**, which are a common requirement in Content Hub implementations. Backfilling a Single Field in Sitecore Content Hub Without Fighting Required Fields If you've ever run a backfill in Sitecore Content Hub — "populate this one new property across tens of thousands of entities" — you've probably hit the wall this post is about. The task sounds trivial: load the entity, set the value, save. But the moment your entity definition has required members , and especially when some of those required members carry default values you were never told about , the "obvious" save path starts throwing errors, and you're left wondering why updating one harmless field is so hard. This is the approach that actually works: skip SaveAsync entirely ...

Optimizing Publishing V2 in Sitecore AI: Content Dependencies, Templates & Experience Edge

Image
Hello everyone, and welcome to another blog post. Today we'll explore something interesting about the new publishing approach introduced in Sitecore AI. Specifically, we'll look at the settings worth enabling early — during template creation and development — to save yourself from unnecessary rework down the line when working with Edge Runtime publishing (V2). If you have moved to Publishing V2 in Sitecore AI (XM Cloud) and noticed that edits to a referenced or child item don't always make it to Experience Edge , you are not imagining it. Publishing V2 is built for speed, and by default it favours smaller, faster publishes over exhaustively scanning every related item (Basically in Snapshot publishing). That trade-off is great for performance, but it can leave your published content "less complete" than you expect. This post walks through the settings that control how thoroughly Publishing V2 resolves dependencies, and th...

Beyond Permissions: Customizing Asset Action Visibility in Sitecore Content Hub - Part2

Image
Hello everyone! I hope you’re doing well. Let’s continue exploring how we can customize asset action visibility in a Content Hub external component. In my previous blog, Beyond Permissions: Customizing Asset Actions in Content Hub , we discussed how to hide the Download button on the asset search page for assets belonging to a specific source system. However, there’s another important aspect we haven’t covered yet: What happens when a user tries to download the same asset using a bulk operation? Hiding the Download button from the asset card is one thing, but ensuring that the same restriction applies to bulk operations is equally important. In this blog, we’ll explore how we can handle this scenario using a Content Hub external component. When policies cannot fully address this requirement, we can still rely on our trump card: an external component. In this scenario, we’ll continue using the same source system, KOL , to demonstrate how we can control asset actions for assets belo...