Quickstart
Scaffold a Superwall Framework project, preview your first paywall in the studio, and ship it to production.
This guide takes you from nothing to a live paywall: scaffold a project inside your app, preview it locally, and push it to Superwall.
Before you start
You'll need:
- Node 20.12+ (or Bun) and git.
- A Superwall account with an application to push to.
- The Superwall CLI:
bun add -g superwallnpm install -g superwallSUPERWALL_CHANNEL=nextin your shell. The CLI'snextchannel is where experimental and beta features live, and the framework is on it; without the variable the CLI has nocreate. Addexport SUPERWALL_CHANNEL=nextto your shell profile (for example~/.zshrc) so every later command, yours or your agent's, stays on the channel. See Channel.
- 1
Create the project
From the root of your app's repo:
superwall createThis scaffolds a self-contained
superwall/directory, its ownpackage.json, a starter paywall, and everything wired up, then connects it to your Superwall app and installs dependencies. Your app itself needs no npm setup.To skip the app picker, pass the app's id:
superwall create --app <id>.superwall apps listshows every app with its id.To start from a working pattern instead, scaffold any example. Each is a complete project:
superwall create --example multi-page - 2
Preview in the studio
superwall devThis opens the studio at
http://localhost:6100: every paywall as a card with a live preview, and an editor per paywall with a device-frame view at exact logical size. Switch devices, toggle light and dark, rotate, change locales, and buy: the studio hosts the paywall the way the SDK does and asks you to pick each purchase outcome, so you can test every branch of your flow. See The studio for the full tour.Edits hot-reload as you save. Warnings about project problems (a stray file in
app/, a duplicate route) appear here too. They're the same checks that block a push, so fix them as they come up. - 3
Make it yours
Open
superwall/paywalls/<id>/and edit. A paywall is ordinary React:// app/index.tsx import { useProducts, usePurchase, useActions, useHaptics } from "superwall/hooks"; export default function Paywall() { const { getProduct } = useProducts(); const { purchase } = usePurchase(); const { close } = useActions(); const haptics = useHaptics(); const annual = getProduct("annual"); return ( <main> <button aria-label="Close" onClick={() => { haptics.light(); close(); }}>×</button> <h1>Go Pro</h1> <button onClick={async () => { haptics.light(); const result = await purchase("annual"); if (result.status === "completed") haptics.success(); }} > {annual?.variables.price ? `Subscribe · ${annual.variables.price}` : "Subscribe"} </button> </main> ); }One thing to know from day one: product data arrives at runtime. Prices come from the store on a device and from your dashboard in the studio, and either host can deliver a product before its data, so guard every read rather than assuming a number is there. See Products.
- 4
Point at real products
config.tsdeclares product slots. The key is the name your code uses; the value is the store identifier:import { definePaywall } from "superwall/config"; export default definePaywall({ name: "Pro — Annual", products: { annual: "pro_5999_year", }, });The identifiers must exist as products on your Superwall dashboard. A push refuses otherwise. Create them in the dashboard, or from the CLI with
superwall products create. See Products. - 5
Push, then promote
superwall push # build + seal an immutable version — production untouched superwall promote # point production at the latest pushPush saves, promote ships: the same split as git push and a deploy.
superwall publishdoes both in one step. The first push binds each paywall to your dashboard and records the binding insuperwall.lock; commit that file so every machine and CI push to the same paywalls. See Push, promote & publish. - 6
Show it in your app
Where to next
Project structure
The full directory layout, the two generated files, and what to commit.
Pages & navigation
Turn one page into a multi-step flow.
Purchases
Handle completed, abandoned, and failed, and why the buy button never shows a spinner.
Examples
Complete projects for product selection, onboarding quizzes, trials, and more.
How is this guide?
Superwall Framework
Build paywalls, onboarding funnels, and web checkout flows as React mini-apps, in your repo, with your tools, shipped without an app update.
Build Paywalls with an AI Agent
Describe a paywall in plain English and let an AI agent build it, preview it in the studio, and ship it to Superwall. No commands to type.