Once UI Blog
Builder stories
Posts
Once UI
What we built with Claude for Open Source
Once UI joins the Neon Open Source Program
Design tokens your agent can follow
How coding agents read the Once UI component catalog
AGENTS.md for design systems
What is an agentic design system?
Once UI 2.6: it thinks in a cube
Once UI Stack chat: an AI chat with a face
Once UI 2.5: reactions that move
Once UI 2.4: ready for AI apps
Once UI 3.0 beta: one way to say it
Stack languages: your app in Hungarian, or in two
Stack store: your shop on your own site
Liquid Metal: chrome that never sets
Chirio, redesigned
Styled screenshots in Chirio
Once UI 2.3: made for real apps
Frametic is now a video and capture studio
Agents write about 40% less code from Stack
Magic Portfolio, now on Once UI 2
Frametic MCP: let your agent film your site
Once UI Stack: your site as a desktop app
Once UI Stack, redesigned
Stack: teams and billing
Prism Glow: soft prism light behind your sign-in screen
Once UI for React Native: the same props on a phone
Once UI 2.2: chat, forms and mobile
Dither: your own image or video as a dithered print
Once UI 2.1: The pieces apps kept asking for
Once UI 2.0: A system an AI can build with
What made Once UI 2.0 possible
Once UI 2.0 alpha: Measured, not assumed
Colour arrives in pairs
Once UI 1.8: Polish as a feature
Once UI 1.7: Form with Intent
From products to systems: a new service model
Magic Journal: A different medium for long-form writing
Supa Social: The next milestone of our journey
Once UI is open source. Here's how we plan to keep it that way.
Designing a timeless, AI-native brand
Once UI 1.5: Curiosity in code
Once UI 1.4 migration guide: The breakpoint object
Launching in the AI-native era: A guide for indie builders
The first design system for indie builders
Builder Stories
Side and Once UI: From café website to reservation system
SatisPro and Once UI: Scaling smarter review management
IQON and Once UI: Scaling with a design system
Dev: Blending science and code with Once UI
JExcellence and Once UI: Turning experiments into enterprise apps
OsmyReal: Launching a platform for mobile gaming with minimal coding
TrademarkTrademark
Ctrl k
Search…
Sign up
Once UI Blog
Builder stories
Posts
Once UI
What we built with Claude for Open Source
Once UI joins the Neon Open Source Program
Design tokens your agent can follow
How coding agents read the Once UI component catalog
AGENTS.md for design systems
What is an agentic design system?
Once UI 2.6: it thinks in a cube
Once UI Stack chat: an AI chat with a face
Once UI 2.5: reactions that move
Once UI 2.4: ready for AI apps
Once UI 3.0 beta: one way to say it
Stack languages: your app in Hungarian, or in two
Stack store: your shop on your own site
Liquid Metal: chrome that never sets
Chirio, redesigned
Styled screenshots in Chirio
Once UI 2.3: made for real apps
Frametic is now a video and capture studio
Agents write about 40% less code from Stack
Magic Portfolio, now on Once UI 2
Frametic MCP: let your agent film your site
Once UI Stack: your site as a desktop app
Once UI Stack, redesigned
Stack: teams and billing
Prism Glow: soft prism light behind your sign-in screen
Once UI for React Native: the same props on a phone
Once UI 2.2: chat, forms and mobile
Dither: your own image or video as a dithered print
Once UI 2.1: The pieces apps kept asking for
Once UI 2.0: A system an AI can build with
What made Once UI 2.0 possible
Once UI 2.0 alpha: Measured, not assumed
Colour arrives in pairs
Once UI 1.8: Polish as a feature
Once UI 1.7: Form with Intent
From products to systems: a new service model
Magic Journal: A different medium for long-form writing
Supa Social: The next milestone of our journey
Once UI is open source. Here's how we plan to keep it that way.
Designing a timeless, AI-native brand
Once UI 1.5: Curiosity in code
Once UI 1.4 migration guide: The breakpoint object
Launching in the AI-native era: A guide for indie builders
The first design system for indie builders
Builder Stories
Side and Once UI: From café website to reservation system
SatisPro and Once UI: Scaling smarter review management
IQON and Once UI: Scaling with a design system
Dev: Blending science and code with Once UI
JExcellence and Once UI: Turning experiments into enterprise apps
OsmyReal: Launching a platform for mobile gaming with minimal coding
Once UI

Stack: teams and billing

Stack apps can hold organizations with roles, invite people by link, and bill each organization for a plan on Stripe, with usage-based prices from one plans.json and a mock mode that needs no Stripe account.
Updated 21 days ago
Once UI Stack, redesigned
Prism Glow: soft prism light behind your sign-in screen
TrademarkTrademark
Once UIDocumentationBlog
© Once UI. All rights reserved.
Built with Aveiro
Stack, the Once UI app template and scaffolder, now has teams and billing. An app built on it can hold organizations with owners, admins and members, invite people by link with a role, and bill each organization for a plan on Stripe. Without Stripe keys, billing runs in a mock mode, so the whole flow works on your machine before you open a Stripe account.
0:00 / 0:00
Stack teams and billing at a glance, slide 1 of 8
Stack teams and billing at a glance, slide 2 of 8
Stack teams and billing at a glance, slide 3 of 8
Stack teams and billing at a glance, slide 4 of 8
Stack teams and billing at a glance, slide 5 of 8
Stack teams and billing at a glance, slide 6 of 8
Stack teams and billing at a glance, slide 7 of 8
Stack teams and billing at a glance, slide 8 of 8

What is in it

  • Organizations. Create one from the organization switcher. Every user also gets a personal organization on their first sign-in, and organization pages live under /app/<slug>/.
  • Invitations by link. Invite someone by email with a role, Member or Admin. Stack gives you a link that works once, for that address, for 7 days. The person signs in and lands back on the invitation to accept it.
  • A Users table. Members load page by page from Supabase, with search by email, a role filter, sorting, a role dropdown on each row and a menu to remove someone or leave. The owner's row is locked.
  • Billing per organization. The plan belongs to the organization, not to the person who bought it. The billing page shows the current plan, monthly and yearly prices, checkout and Stripe's customer portal.
  • Usage-based prices. A plan can carry metered prices, and one script creates the Stripe meters and prices for them.
  • Login and sign-up forms now group their fields with Once UI's Form.
The Users page of a Stack app: a search field, an All roles filter, an Invite button and a table of members with a role dropdown and an actions menu on each row

How to use it

Teams and billing come as two slices, orgs and billing. Name them when you scaffold an app. billing needs orgs, which brings auth, and the scaffolder adds those for you:
The Invite someone dialog: an email field with a Member or Admin role menu inside it, and Cancel and Create invitation buttons
In your Supabase project, run supabase/init.sql, then supabase/orgs.sql, then supabase/billing.sql in the SQL editor. Copy .env.example to .env.local and add your Supabase keys. That is enough to run the whole flow in mock mode: choosing a plan activates it in the database directly, and the billing page says so in a banner.
The billing page of an organization called Acme in mock mode: the Team plan is active, with Free, Pro and Team plan cards and a Monthly and Yearly switch
The plans live in src/resources/plans.json. When you are ready for Stripe, set STRIPE_SECRET_KEY and create the products and prices from that file: The script prints a STRIPE_PRICE_<KEY> line for each price to put in your environment. Then point a Stripe webhook at /api/webhooks/stripe for checkout.session.completed, customer.subscription.created, .updated and .deleted, invoice.paid and invoice.payment_failed, and set STRIPE_WEBHOOK_SECRET. To put a feature behind a plan, check it in the route: Someone outside the organization still gets a 404 and learns nothing about its plan. A member whose plan lacks the feature gets a 402.
An invitation page: You're invited to join Acme, as an admin, with an Accept invitation button

How it works

One file for plans. The billing page renders from plans.json, the server reads checkout prices and features from it, and stripe:sync creates Stripe's products and prices from it. A metered price is one more entry: That reads "10,000 calls included, then $0.0005 each", and the plan card shows it as "10,000 api_call included, then $0.0005 each". Amounts are in cents and can be fractions of a cent. stripe:sync creates the Billing Meter and a graduated metered price, and running it again reuses both until a tier changes. A changed price gets a new Stripe price and the old one is archived, so nobody's bill changes because a file did. Checkout puts the flat price and its metered prices on the same subscription, and reportUsage sends a meter event for the organization. A mirror kept by the webhook. Live subscriptions are copied into a billing_subscriptions table, so checking a plan is one read. The webhook does not trust what an event says: it fetches the subscription from Stripe again. Duplicate, retried or late events all end up at Stripe's current state. Only active and trialing count, so a failed renewal stops access right away, and an organization with a live subscription cannot be deleted. No new dependency. Stripe is called with plain fetch, and webhook signatures are checked with node:crypto. Mock mode can never run in production: with no key and NODE_ENV=production, checkout refuses with a 503. A table that pages on the server. The Users table is Once UI's DataTable in server mode. Search, the role filter, sorting and paging go to the members API as query parameters, so a large organization never loads everyone at once.
A member row's actions menu open on the Users table, with Remove from organization
Seat-based pricing and proration previews are not in it yet. The billing guide in the repo, docs/composition/billing.md, has the full routes and modes.
Share
node scripts/scaffold.mjs --surfaces landing,dashboard --slices billing --out ../my-app
npm run stripe:sync -- --dry-run   # print the plan, touch nothing
STRIPE_SECRET_KEY=sk_test_… npm run stripe:sync
const gate = await requireOrgFeature(slug, "api");
if (!gate.ok) return NextResponse.json({ error: gate.error }, { status: gate.status });
{ "key": "team-api-calls", "interval": "month", "meter": "api_call",
  "tiers": [{ "upTo": 10000, "amount": 0 }, { "upTo": null, "amount": 0.05 }] }