Docs / wallet / paywall-app

paywall-app

recipesince 0.2.8

Charge users of the app for access (unlock fee or metered queries) using the platform paywall

Plane: monetization

Steps: 1. casino_set_monetization — Owner enables monetization on the site (pricing mode + amounts) — this is platform-level config, not app code. 2. AppPaywall — Wrap the app content in <AppPaywall siteId={config.appScope}> — renders the unlock CTA when access is denied. 3. useAppAccess — Use directly only for custom gate UI (hasAccess, queriesRemaining, checkout); AppPaywall already handles the default.

Examples

End-to-end example
import { AppPaywall } from '@flowstack/sdk/paywall';

export default function App() {
  return (
    <AppPaywall siteId={import.meta.env.VITE_APP_SCOPE}>
      <YourAppContent />
    </AppPaywall>
  );
}
WarningImport from '@flowstack/sdk/paywall' (0.3.2+), NOT '/wallet' — the wallet entry statically imports the wagmi peer dep and fails built-app builds.
WarningMonetizing the app = platform paywall. Do NOT wire raw Stripe calls to charge app users (that is the call-stripe-api anti-case).
WarningThe backend gate enforces access regardless — AppPaywall is the UI surface, never the security boundary.
WarningThe app_paywall SSE event fires mid-conversation when metered credits run out; AppPaywall listens for it automatically.

See also

call-stripe-api · casino_set_monetization · AppPaywall · useAppAccess

Source: sync-recipes.mjs ← https://sage-api.flowstack.fun/recipes.json · Also available in llms-full.txt and registry.json.