Skip to content

Paywalls

Paywall rules determine which content is gated and how.

Rules are evaluated in ascending priority order. The first matching rule wins.

TypeBehavior
MeteredAllow N free views, then deny
HardDeny unless the user has a matching subscription
RegistrationDeny unless a userId is present
SoftGrant access and return a paywall hint

The current dashboard form primarily exposes URL-based conditions.

Available URL operators are:

  • contains
  • matches
  • eq

The access engine also supports has_user and segment_id, but the current UI focuses on URL matching.

Each rule stores:

  • productIds
  • optional message
  • optional meterLimit
  • optional template — chooses which surface the SDK mounts when Latch.showPaywall(result) runs (see UI Components)
  • optional position — only meaningful for sticky-bar; either top or bottom

The dashboard’s Create Rule form exposes five templates. Each maps to a Web Component shipped in @latch/ui:

TemplateWeb componentSurface
modal<latch-paywall-modal>Centered overlay that blocks the page until the reader subscribes or dismisses. The default.
bottom-bar<latch-sticky-bar>Sticky bar pinned to the bottom of the viewport (position is forced to bottom). Non-blocking soft prompt.
inline<latch-inline-paywall>In-flow card mounted into the element matched by paywallSelector on Latch.init() (falls back to <body>). Renders alongside content rather than over it.
sticky-bar<latch-sticky-bar>Same as bottom-bar, but reads action.position (top or bottom). Use this when you want a top-pinned bar.
inline-lock<latch-content-lock>Truncates the article with a gradient fade and renders a CTA overlay below. Place a <div id="latch-lock"></div> marker where the cut should start, or rely on auto-detection of <article> / <main>.

For newsletter and data rule types, the SDK ignores template and routes to <latch-newsletter-wall> or <latch-data-wall> respectively.

Rules can be toggled active or inactive without deleting them.

Soft paywalls return granted: true. If you want a visible prompt for soft rules, your integration should inspect the returned paywallRule and render the prompt itself.

Content categories live alongside paywall rules under Paywalls → Categories (formerly Settings → Content Categories; the old URL still redirects). A category mapping is just a URL pattern → category name pair: when a request URL matches the pattern, the access engine derives a content_category value, which is then available as a field in the rule builder.

The flow is:

  1. Define a mapping (e.g. /sports/** → sports) under Paywalls → Categories.
  2. In a paywall rule, add a Content Category condition (e.g. is "sports"). The rule builder shows a Manage categories → deep-link next to the field for quick access.
  3. At request time the engine resolves the request URL to a category, evaluates rules, and returns an access decision.

Old bookmarks for /settings/content-categories are redirected to /paywalls/categories.