Table of contents
What you'll ship
A "Subscribe" button that opens Stripe's hosted checkout in subscription mode, a members-only part of your app, and a check that keeps it honest: before serving a members-only page, your app's server asks Stripe whether that member's subscription is still active, and remembers the answer for a few minutes.
There is no billing screen inside your app. Members who want to cancel contact you, and you cancel in the Stripe dashboard; the app sees the change at its next check.
Before you start
You need the one-time checkout working first, with your Stripe test key connected under More > Payments. See the previous playbook, "Add Stripe to a Fabricate App in 30 Minutes". The same key covers subscriptions.
Note
If your app already has sign-in, subscriptions attach to each member's account. If not, ask for sign-in in the same prompt: Fabricate adds email and password accounts when the app needs them.
Step 1 · Ask for the membership (5 min)
Describe the plan in your Fabricate chat: its name, its price, monthly or yearly, and what members get.
Tip
Want yearly billing too? Ask for "$190 a year as well, with a Monthly / Yearly switch". Each interval is its own checkout, and nothing needs setting up in Stripe.
Add a "Pro membership" at $19 USD a month. Signed-in users get a Subscribe button on /pricing that opens Stripe Checkout in subscription mode. Save the subscription on the member's account, and only show the /members pages to members whose subscription is active or trialing.
Ready to build?
Describe your app in a few sentences and Fabricate builds it. Free to start.
Start building freeStep 2 · Test it in the preview (10 min)
Open the preview, sign in as a test member and click Subscribe. Stripe's page opens in a new tab. Pay with card 4242 4242 4242 4242, any future expiry date and any CVC.
Back in the app, the members pages open once the server has confirmed the payment with Stripe. In the Stripe dashboard (test mode), the subscription appears under Subscriptions.
Step 3 · Test a cancellation (5 min)
In the Stripe dashboard, open the test subscription and cancel it immediately. Within a few minutes the members pages close for that member, because the app's next status check sees "canceled".
Important
If the members pages stay open long after cancelling, the status check is missing or remembered too long. Ask Fabricate: "Check the member's Stripe subscription status before serving /members, remembered for at most five minutes."
Step 4 · Go live (5 min)
Add your live secret key under More > Payments and publish again: a live key reaches only the published app, from its next publish. You don't re-create products, prices or webhooks in live mode, because the app sends each plan with every checkout. Test subscriptions stay in Stripe's test mode and never charge anyone.
Ready to build?
Describe your app in a few sentences and Fabricate builds it. Free to start.
Start building freeGotchas worth knowing
A short list of the things that come up the week after launch:
• Grace period. When a renewal fails, Stripe retries the card before cancelling, and the subscription is past_due meanwhile. Fabricate counts only active and trialing as paid up; if you'd rather keep access during the retries, ask for past_due to count too.
• Cancelling and card problems. There is no self-serve billing page in the app. Say on your members page how to reach you, and handle cancellations and failed cards in the Stripe dashboard.
• Tax. Stripe Tax can work out EU VAT and US sales tax; you switch it on and set it up in the Stripe dashboard.
• Refunds. Refunds happen in the Stripe dashboard, not in your app.
What's next
You're billing members every month. Two natural follow-ons:
• Offer more than one plan. Prompt: "Add Basic at $9 a month next to Pro at $19, each unlocking its own pages." Each plan is its own subscription checkout.
• Show members their plan. Prompt: "Add an account page that shows the member's plan, its status from Stripe, and how to contact us to cancel."
Ready to build?
Describe your app in a few sentences and Fabricate builds it. Free to start.
Start building free