Typestate
Sign in

Launch waitlist with referrals

People join a waiting list from your page, and each friend they bring moves them up.

For a maker who collects email addresses before a launch.

Resend logo Resend
Start it with your agentUses 4 of your 100 changes a month

Start the launch waitlist with referrals blueprint on Typestate

Asked you for the address your emails come from.

Started Launch waitlist with referrals: 1 record types, 4 web endpoints.

4 actions are compiling, one change each.

Deployed to Sandbox. Try it at your Sandbox address.

What your agent does when you start this blueprint

How it runs

Who does what, in order. Each step is one action of the backend.

  1. A visitorjoins from your page and gets their own linkJoin the Waitlist
  2. A friendjoins through that link, and the first person moves 5 places upJoin the Waitlist
  3. A visitorchecks their placeShow My Place
  4. Youinvite the next 50 when you are readyInvite the Next People

The rule you will want to change first

Each person who joins through your link moves you 5 places up the list.

It lives in the action Join the Waitlist. Tell your agent how you want it instead: one sentence changes, and you read the change before it goes live.

What it is made of

What it keeps, what it does, and what it reaches.

What it keepsSignupemail, name, referralcode, referred by,friends, score, stateWhat it doesJoin the Waitlistcalled by anyoneShow My Placecalled by anyoneInvite the NextPeoplecalled by you, withyour keyRead the Listcalled by you, withyour keyWhat it reachesResendSend email from yourown address: sign-in...Your website4 web endpointsWhat it keepsSignupemail, name, referralcode, referred by,friends, score, stateWhat it doesJoin the Waitlistcalled by anyoneShow My Placecalled by anyoneInvite the NextPeoplecalled by you, withyour keyRead the Listcalled by you, withyour keyWhat it reachesResendSend email from yourown address: sign-in...Your website4 web endpoints

What it keeps

Signup

7 fields

One person on the list, with their place and the friends they brought.

email
required, an email address, never twice
name
optional, at most 120 characters
referral code
required, never twice, at most 8 characters
referred by
optional
friends
required, a whole number
score
required, a whole number
state
required, one of waiting, invited

Anyone can read and write it.

What it does

Every action, with its full definition in plain English.

Join the WaitlistA person joins from your page, and gets an email with their own link.
Anyone can join the waiting list with an email address, an optional name and, if a friend sent them, that friend's referral code. 1. If the address is already on the list, refuse with "This address is already on the list". 2. Make a new referral code of 8 random letters and digits for the person. 3. The person's number is the number of people on the list plus one. Their score starts as that number. 4. If a referral code was given and it belongs to somebody on the list, add 1 to that person's friends and take 5 off their score. A code that belongs to nobody is ignored, and the person still joins. 5. Save the person as waiting, with the code of the friend who sent them. 6. Send the person an email: subject "You are on the list", saying their place and their own link, which is the site address with ?ref= and their referral code on the end. 7. Answer with the person's place and their referral code.
Show My PlaceA person sees their place, from the code in their link.
Given a referral code, show that person's place on the list. 1. If no person on the list has that code, refuse with "No place matches this link". 2. If the person was already invited, answer that they are invited. 3. Otherwise their place is the number of waiting people with a lower score, plus one. When two scores are the same, the person who joined first is ahead. 4. Answer with the place, the number of friends they brought, and how many people are waiting in total.
Invite the Next PeopleYou invite the next people in the queue, and each gets an email.
The owner invites a number of people from the front of the list, from 1 to 50. 1. If the number is less than 1 or more than 50, refuse with "Invite between 1 and 50 people at a time". 2. Take that many waiting people with the lowest scores. When two scores are the same, the person who joined first goes first. 3. Mark each one invited. 4. Email each one: subject "You are in", saying that their access is ready. 5. Answer with how many people were invited and how many are still waiting.
Read the ListYou read the list, newest first, with each person's place and state.
The owner reads the waiting list. Answer every person on the list, newest first, with their email, name, state, the number of friends they brought and their score. The owner may ask for only the waiting people or only the invited people. Also answer how many are waiting and how many are invited.

Who signs in

People sign up and sign in with an email address and a password, or with a provider you add, such as Google.

  • Signup: Anyone can read and write it.

Web endpoints

What it doesWho may callAddress
Your page posts the form here.anyonePOST /waitlist
Your page shows a person their place.anyoneGET /waitlist/place
Only you, with your key, invite people.you, with your keyPOST /waitlist/invite
Only you, with your key, read the list.you, with your keyGET /waitlist

What it cannot do yet

  • It does not check that an address is real before a person takes a place. Add a proof by email with set_email_verification if spam becomes a problem.
  • It does not build the page. Your site posts the form to it.

Build the pages with your tool

Typestate is the backend. Paste this brief into Lovable, v0, Claude Code or the tool that builds your pages.

Show the brief
Build the pages for "Launch waitlist with referrals". The backend runs on Typestate and answers these web endpoints: POST /waitlist: Your page posts the form here. Who may call: anyone. GET /waitlist/place: Your page shows a person their place. Who may call: anyone. POST /waitlist/invite: Only you, with your key, invite people. Who may call: you, with your key. GET /waitlist: Only you, with your key, read the list. Who may call: you, with your key. People sign up at POST /auth/signup and sign in at POST /auth/login, which answers a token. Send it as Authorization: Bearer <token>. A refused call answers a sentence that can be shown to the person as it is.

Start it

  1. Tell your agent the sentence on the right.
  2. It asks you for the address emails come from, on a domain you verified at Resend, such as "Riverside Physio <hello@riverside.example>".
  3. It tells you what only you can do, such as pasting your Stripe key. A key never goes through the agent.
  4. Open your Sandbox address and try it yourself.

Uses 4 of the 100 changes a month on the Free plan, which runs it on Sandbox. Taking real money on Live needs a paid plan.

Start the launch waitlist with referrals blueprint on TypestateOpen an account

Related blueprints