sesamy-content-container
A web component that controls access to content based on user authentication and entitlements, with support for different content locking mechanisms.
Props/Attributes
item-src- URL of the content itempass- Semicolon-separated list of pass IDs that grant accessaccess-level- Access level required ('public', 'logged-in', or 'entitlement')publisher-content-id- ID of the content from the publisherlock-mode- Content locking mechanism ('embed', 'encode', 'signedUrl', 'event', or 'proxy')locked-content-selector- CSS selector for locked content when using signed URLs
Events
sesamyUnlocked- Dispatched when content is unlocked (withitem-srcandpublisher-content-idin detail)
Basic Usage
<!-- Basic content container with preview and locked content -->
<sesamy-content-container item-src="https://example.com/article.html">
<div slot="preview">This is a preview visible to everyone</div>
<div slot="content">This is the full content for authorized users</div>
</sesamy-content-container>
<!-- Content visible only to logged-in users -->
<sesamy-content-container access-level="logged-in">
<div slot="preview">Please log in to view this content</div>
<div slot="content">This content is for logged-in users only</div>
</sesamy-content-container>Access Levels
public
Content is accessible to everyone without authentication.
logged-in
Content requires user to be authenticated but doesn't check for specific entitlements.
entitlement
Content requires specific entitlements (passes) to access. Use the pass attribute to specify required pass IDs.
Lock Modes
embed
Content is embedded directly in the page and shown/hidden based on access.
encode
Content is encoded and decoded on the client side when access is granted.
signedUrl
Content is loaded from a signed URL when access is verified.
event
The component dispatches events for the application to handle content loading.
proxy
Content is loaded through a proxy server that validates access.
Slots
preview
Content shown to users who don't have access. This typically includes a teaser or summary.
content
The full content shown to users with proper access (authentication/entitlements).