Skip to content

Recommended API Path

The SDK has a large surface, but most integrations only need a handful of calls. Reach for these first; everything else is Advanced.

Almost every monetization decision is one of two questions:

  • “Can this user do X?”check it with can() (or the useEntitlement hook).
  • “Only let them do X if they’re entitled — and show an upsell if not.”protect it with gate() (imperative) or <Gate> (declarative React).

And when you just want to render whatever the control plane decides for a spot in your UI, drop in a <Slot>.

You want to…UseKind
Check access imperativelyrt.can(handle)EntitlementResultverb
Check access in ReactuseEntitlement({ handle }) / useCan(handle)hook
Run an action only if entitledrt.gate(action, fn){ ran, entitlement }verb
Gate a React subtree + show an upsell<Gate can="…">…</Gate>component
Render a control-plane placement<Slot id="…" />component
Track an eventrt.track(name, data)verb
Report usagert.update({ usage })verb

They sound alike but do different jobs:

  • can() asks — it returns the answer and does nothing else.

    const access = await rt.can('data_export');
    if (!access.allowed) showUpgrade();

    It returns the rich EntitlementResult (allowed, status, reason, and — for limit-bearing entitlements — limit / used / remaining). can() is asynchronous by design, so custom resolvers can be injected.

  • gate(action, fn) asks and acts — it runs fn only when the user is entitled, and hands back the entitlement so you can open a paywall otherwise.

    const gated = await rt.gate('export_pdf', () => exportPdf());
    if (!gated.ran) openPaywall(gated.entitlement);
  • <Gate> is the declarative React version — it renders its children when access is granted and the resolved upsell placement when it isn’t.

    <Gate id="editor_export" can="data_export">
    <ExportControls />
    </Gate>

Three names cover the customer-facing surface:

  • <Slot> — the general placement slot. It renders whatever placement the control plane resolves for a spot (banner, modal, toast, meter, …).

    <Slot id="pricing_banner" />
  • <Gate> — the entitlement gate (above): render children when entitled, an upsell when not.

  • Playbook — the portable monetization config the SDK evaluates against: plans, entitlements, segments, and placements. In local mode you load it (typically playbook.json) at init; in live mode the SDK fetches it.

Each has an older name that stays exported — prefer the canonical one:

CanonicalAlso exported asWhat it is
<Slot>SurfaceSlotComponent, RTSlotgeneral placement slot component
<Gate>AccessGateSurfaceSlotentitlement-gate component
PlaybookPlaybook, Playbookthe portable monetization config

Provider architecture, custom slot types, headless controllers (usePlacement and the imperative controllers), theming internals, and the generated object detail are all still available — they’re just not the first thing you reach for. See the Guides and the API Reference when you need them.

  • Quickstart — gate one action end to end
  • Entitlements — the full entitlement model behind can() / gate()
  • Placements — what <Slot> renders and how decisions resolve