Skip to main content
Presents the offer carousel and resolves when the user claims an offer, dismisses the carousel, or no offers are eligible. Claiming opens the advertiser in a new tab inside the claim gesture; the SDK renders nothing after a claim, and the host owns the post-claim moment.

When to use this

Call show() at the moment you want to present an offer: a cancel flow, a paywall, an onboarding step, a celebration screen. There is no second call to make afterward. Most integrations present via the fluent placement(id).show() builder, which resolves the same ShowResult; Encore.show() is the inline one-call variant, and the only form that accepts an onError callback.

Signature

placementOptions and placementId mirror the fluent placement(id, options).show() form. The builder’s own show() takes no arguments at all: onNotGranted is set once via placement(id).onNotGranted(), and the builder has no onError equivalent. Use the inline form shown here if you need that callback.

Parameters

ShowResult

reason (a NotGrantedReason) is one of 'userClosedModal', 'userClickedOutside', 'userDeclinedLastOffer', 'noOffersAvailable', 'notConfigured', 'alreadyPresenting', or { type: 'error', error }. Two of those describe a sheet that never appeared rather than one the user dismissed: Both names match the native SDKs’ vocabulary for the same conditions.

The claimed payload

The payload mirrors the iOS and Android ClaimedOffer field for field, so a cross-platform integration reads one shape everywhere.
transactionId is optional by design. The transaction write can fail while the claim itself genuinely happened. The SDK logs a warning naming the attribution consequence rather than fabricating a placeholder, and the result still resolves claimed: a failed write must not retroactively turn a real claim into a decline.
show() never rejects. There is no crash path and no try/catch needed: a failure resolves as { status: 'dismissed', reason: { type: 'error', error } }, and calling show() before configure() resolves as { status: 'dismissed', reason: 'notConfigured' }.
The result makes no conversion claim. claimed means the user accepted an offer and was handed off; the advertiser completion happens later, asynchronously, via server-side postbacks. Verify completions and entitlements server-side, by user, with Encore’s server-side entitlements API, never from the client, and never from this result.

Examples

Present and branch

With a use case and copy

Gotchas

  • unavailable is overloaded. It means “no eligible offers”, “measurement control cohort (ghost trigger)”, or “nothing to present for the requested useCase”; the SDK keeps them indistinguishable on purpose so incrementality experiments aren’t contaminated. Don’t branch app behavior on a suspected control assignment; just show your normal fallback.
  • An unrecognized useCase fails loudly, not silently. A typo or an unsupported value (not 'reduceChurn' or 'rewardUsers') resolves dismissed with an INVALID_REQUEST error, firing both onError and onNotGranted immediately, before any presentation attempt. That’s an integration bug, not a normal outcome: don’t confuse it with the silent unavailable a valid useCase with nothing to present produces. The values Encore sends over the wire are not accepted here; passing one is exactly this error. See Errors.
  • onError doesn’t catch every error result. It fires when the flow never started or threw, not when the flow returns an error. Branch on reason.type === 'error' if you want to catch both classes.
  • Nothing renders after a claim. There is no built-in success screen; if that flow needs a confirmation moment, render it yourself when the result is claimed.
  • show() doesn’t need a click handler. The advertiser tab opens inside the user’s tap on Claim, within the SDK’s own sheet, so popup blockers have nothing to catch.
  • Claim is not a conversion. Never grant access off a claimed result; verify entitlements server-side, by user (see the preceding warning).
  • The Claim Flow: what a claim does, and what its payload carries.
  • placement: present at a named placement, and the full options contract.
  • Errors: the error-as-value contract.
  • Updating to 2.x: moving off the two-phase flow.