Unlocking Content with Entitlements
This article explains how to unlock content for your subscribers with Cleeng entitlements.
Managing subscriber access to your digital assets can be complex - especially when dealing with multiple platforms, devices, and subscription scenarios. Cleeng simplifies this process with a robust, integrated entitlement engine that works in real-time, scales with peak volumes, and protects your valuable content.
With Cleeng, you can unlock a variety of digital assets: full or partial app access, video streams, articles, or downloadable resources. This guide walks you through the basics of integrating Cleeng entitlements and explores advanced options for managing subscriber access efficiently.
How Cleeng entitlements work
Cleeng automatically updates entitlements for each subscriber in real-time. Whenever a subscriber’s status changes - whether it’s a free trial, an initial purchase, an in-app upgrade, a refund, a chargeback, or a failed recurring payment - the entitlement engine ensures that access rights are updated immediately.
The result: you can check access for any user any time without additional complexity or manual work.
To unlock content for subscribers, you typically need just one API call. This tutorial covers both basic integration and more advanced configurations.
Tip
Many partners have pre-integrated Cleeng entitlements with their content management system (CMS) or Online Video Platform (OVP). Check with your CMS/OVP provider before implementing your own integration..
When to check for entitlements
Entitlement checks should occur immediately after user login to determine content access and prevent duplicate purchases, and again right before serving any specific asset to enforce the correct access level and trigger protections such as DRM or license keys.
Understanding the Entitlement Object
At a technical level, an entitlement is an object representing a customer’s right to access a specific offer (offerId
), or tag (see below). It is the core mechanism for controlling access and is primarily managed via Cleeng’s APIs.
A sample entitlement object:
{
"accessGranted": true,
"expiresAt": 1651915800,
"message": "Success",
"customerId": 123456789
}
The most important property is accessGranted
, which indicates whether the user can access the content. Your service only needs to check this flag - no subscription status interpretation is required. Please do not use the expiresAt
for granting access, as due to a Grace period or reconciliation scripts this can be lapsed while the access is still valid.
Option 1: Backend integration with Core API (Recommended)
Use case:
Maximum control, custom business logic, enterprise-grade security.
Prerequisites
- Developer access to the back-end service that delivers your content.
- Your Cleeng API key (publisher token) from the dashboard.
- Access to the Cleeng
customerId
by decoding the JWT and the CleengofferId
.
How it works
The backend API call checks entitlements by sending the customerId
and offerId
. The API responds with a boolean accessGranted
flag. See examples in PHP and Node.js.
Option 2: Frontend integration with MediaStore APIs
Use case:
Ideal for rapid deployment, testing, or when backend integration is not feasible.
Prerequisites
- Developer access to the frontend that renders content.
- Access to the JWT returned by hosted widgets.
- The Cleeng offer ID.
How it works
The frontend API call checks entitlements using the JWT and offer ID. The response contains the accessGranted
flag, which determines whether the content is shown. See the example in JavaScript.
Advanced entitlement features:
- DRM & License Keys: Protect digital assets further by using digital rights management (DRM) or license keys to prevent illegal distribution. Please consult with your online video platform (OVP) or content management system (CMS) provider.
- Listing Entitlements: Use the List Entitlements API to display all assets a user can access—useful for video libraries with locked and unlocked content.
- Tags: Entitlements can be assigned using “tags” instead of offer IDs, allowing flexible content packaging.
- Grace Period: The
accessGranted
flag determines access, not theexpiresAt
timestamp. Grace periods may allow continued access after expiration. - Regional Access: Assuming you have different content to deliver, you can leverage dedicated offers e.g., S123123123_US vs S789789789_CA, or orchestrate this on the content delivery network (CDN) level via geo-restrictions. Please consult your CDN, OVP or CMS provider.
- Caching Strategy: For high-volume applications, consider implementing a caching strategy to optimize performance. Please validate every 24 hours to not interfere with churn prediction algorithms.
- In-app Systems: For Apple, Google, or other third-party purchases, you can configure server-to-server notifications to keep entitlements synchronized with Cleeng.
Conclusion
Cleeng’s entitlement engine ensures secure, real-time management of subscriber access across platforms and devices. Choosing between backend and frontend integration depends on your technical capabilities, security requirements, and deployment needs.
By implementing entitlements with Cleeng, you guarantee a smooth experience for subscribers while keeping your content protected and accessible only to authorized users.
Up next
Now you can explore specific examples and code snippets to manage entitlements. See the next page for PHP, Node.JS and JavaScript examples.
Updated about 10 hours ago