sesamy-soft-paywall

The soft paywall component selectively restricts content based on specific conditions, such as the user's login status or the number of articles viewed.

Basic usage

<html>
  <head></head>
  <body>
		<sesamy-soft-paywall>
		  <!-- Your restricted content goes here -->
		</sesamy-soft-paywall>

    <script type="module">
      import "https://assets.sesamy.com/scripts/web-components/sesamy-bundle.min.js";
    </script>
  </body>
</html>

API Reference

  • tally (String): A unique identifier for tracking views. Default: 'soft-paywall'.
  • max-views (Number): The maximum number of views allowed before the paywall activates. Default: 3.
  • ttl (Number): Time-to-live in seconds. Defines how long a view is counted towards the max-views. Default: 86400 (1 day).
  • unique-view (Boolean): If set to true, views are counted uniquely based on some criteria (e.g., IP address). Default: false.
  • access-level (String): Defines the access level required to bypass the paywall. Options are public, logged-in, and entitlement. Default: LoggedIn.
  • pass (String): A semicolon-separated list of pass identifiers used for the entitlement check.
  • item-src (String): URL or identifier used to check the entitlement.
  • publisher-content-id (String): An identifier used to fetch the correct entitlement from the HTML.

Example

<sesamy-soft-paywall max-views="5" access-level="logged-in">
  <div class="modal">
    <div class="modal-content">
      <span class="close" onclick="window.history.back()">&times;</span>
      <h2>Unlock Unlimited Access</h2>
      <p>Log in to continue reading without interruptions.</p>
      <sesamy-login></sesamy-login>
    </div>
  </div>
</sesamy-soft-paywall>
Did this answer your question?
😞
😐
🤩