Skip to main content
Returns a fluent builder for presenting offers at a named placement. The id is recorded on the claimed transaction so placement(id).redeem() can later resolve exactly that claim; the options carry per-surface UI configuration.

Signature

All argument combinations work:

PlacementOptions

Structure

PlacementOptions is a union of two layout variants sharing a common base:

Field Reference

FieldTypeApplies toDescription
appearanceAppearanceConfigboth layoutsaccentColor, backgroundColor, textColor: CSS color strings.
layout'list' | 'thankYou'-Layout template; default 'list' (the offer sheet). Unknown values fall back to 'list' with a warning.
redemptionMode'deferred' | 'immediate'both layoutsPer-placement override of the configure() default: the claim↔redeem coupling for this surface. See Redemption Modes.
display{ appDisplayName?, trialPeriod?, logoUrl? }both layouts (consumed by 'list' · deferred)Local override of the portal-managed host display values the deferred screens render; required to resolve (locally or remotely) in 'list' · deferred. See Display Resolution.
header.title / header.subtitlestringboth layoutsTop heading block; an explicit value always wins. Defaults: in 'list' · deferred, the composed “Get free for ” / “Claim a partner offer to start”; in 'list' · immediate, the remote/generic copy; in 'thankYou', title defaults to “Payment Successful”, and a receipt passed to show() supersedes subtitle.
header.icon'success' | 'none''thankYou' onlyStatus check above the title; 'success' (default) renders the green check, 'none' hides it. Ignored by 'list'.
offerContext{ title?, subtitle? }'thankYou' onlyPriming copy above the offers. The subtitle is a fallback; the active offer’s campaign perk line supersedes it.
footer.textstring'thankYou' onlyTrust line below the carousel; omitted → not rendered.
In the 'thankYou' layout the blocks render top to bottom: check icon → header.title → status subtitle (the receipt passed to show(), else header.subtitle) → offerContext copy → the carousel → footer.text. Usage end to end: Reduce Paywall Churn ('list' · deferred) · Post-Purchase Placements ('thankYou').

PlacementBuilder

show(options?)

Presents the offer carousel with this placement’s options and resolves the bare ShowResult ('claimed' | 'dismissed' | 'unavailable'). On a thankYou-layout placement, pass the per-transaction receipt, rendered as the “You paid … for …” subtitle line (render-only, never sent to Encore’s servers).

redeem()

Redeems the claim recorded at this placement, phase 2 of the deferred flow. It never resolves another placement’s transaction (resolves { status: 'none' } if this placement has no pending claim). Contract: redeem().

onNotGranted(callback)

Fires when the sheet closes without a claim, carrying the dismissal reason (the same NotGrantedReason a dismissed result carries).

onLoadingStateChange(callback)

Fires true when the presentation starts loading and false when it settles; useful for spinners and disabling the triggering button. Callbacks are scoped to this builder instance; they don’t persist across calls.

Examples

Two-phase flow at a named placement

Post-purchase placement (thankYou layout)