After signup, users need a reason to come back, and a link to send friends. Awaitlist status page with referral share links in Next.jsis that home base: it shows queue position, explains the referral reward, and gives a copy-paste URL with?ref=. Without it, yourreferral queue systemcollects data but never closes the viral loop.
This guide builds a production-stylestatus pageon the App Router: load the signup byreferralCode, compute effective position, gate unconfirmed users whendouble opt-inis on, and render a share link fromNEXT_PUBLIC_APP_URL, not fragile host headers.
What the status page is responsible for
Job Owner Show queue position Server Component + Prisma Display personal referral URL Server-built string/?ref=CODEEncourage sharing Copy button + short social copy Respect privacy No public leaderboard by default; mask email Block pre-confirm users OptionalconfirmedAtcheck
The signup API and landing form live in other posts; this page isread-mostlyand safe to cache lightly per user (avoid aggressive CDN cache on personalized HTML).
Why a dedicated article?Article 01 shows a minimal status snippet; production pages need redirect rules, copy UX, metadata, privacy, and confirm gates that do not fit one step. Search traffic for “waitlist status page” and “referral share link” expects this page as a first-class route, not an afterthought in the signup handler.
Prerequisites
WaitlistEntrymodel withreferralCode,basePosition, referral relations (article 01).getEffectivePosition()helper counting verified referrals.Optional: confirmation fields from article 02.
Step 1: Choose the URL shape
Two common patterns:
Pattern Example Pros Query param/status?code=abc123Easy post-signup redirect from client JSON Dynamic segment/status/abc123Cleaner share of “your page” (still not the ref link)
UsereferralCodein the URL, not internalid. Codes are already public in?ref=links. Either works; this guide uses?code=to match the signup redirect in article 01.
// After signup response
window.location.href = `/status?code=${encodeURIComponent(data.referralCode)}`;For dynamic routes, createapp/status/[code]/page.tsxandfindUnique({ where: { referralCode: code } }).
Step 2: Build the share URL in one place
Centralize logic inlib/waitlist/share-url.ts:
export function buildReferralShareUrl(referralCode: string): string {
const base = process.env.NEXT_PUBLIC_APP_URL?.replace(/\/$/, "");
if (!base) {
throw new Error("NEXT_PUBLIC_APP_URL is required for share links");
}
const url = new URL(base);
url.pathname = "/";
url.searchParams.set("ref", referralCode);
return url.toString();
}Why notheaders()?Behind Vercel, proxies, or preview deploys, host headers lie. Founders paste broken links on Twitter once and lose a launch day. Optional UTM for your own analytics:
export function buildReferralShareUrl(
referralCode: string,
utm?: { source?: string; medium?: string },
): string {
const url = new URL(buildReferralShareUrl(referralCode));
if (utm?.source) url.searchParams.set("utm_source", utm.source);
if (utm?.medium) url.searchParams.set("utm_medium", utm.medium);
return url.toString();
}Do not put each user’s email in UTM parameters. UsereferralCodeonly.
Step 3: Server Component status page
app/status/page.tsx:
import { db } from "@/lib/db";
import { getEffectivePosition, countVerifiedReferrals } from "@/lib/waitlist";
import { buildReferralShareUrl } from "@/lib/waitlist/share-url";
import { ShareReferralLink } from "./share-referral-link";
type Props = { searchParams: Promise<{ code?: string; confirmed?: string }> };
function maskEmail(email: string): string {
const [local, domain] = email.split("@");
if (!domain) return "•••";
const visible = local.slice(0, 2);
return `${visible}•••@${domain}`;
}
export default async function StatusPage({ searchParams }: Props) {
const { code, confirmed } = await searchParams;
if (!code) {
return <main><h1>Missing status code</h1><p>Use the link from your confirmation email.</p></main>;
}
const entry = await db.waitlistEntry.findUnique({
where: { referralCode: code },
});
if (!entry) {
return <main><h1>Not found</h1><p>We could not find that waitlist entry.</p></main>;
}
const doubleOptIn = process.env.WAITLIST_DOUBLE_OPT_IN === "true";
if (doubleOptIn && !entry.confirmedAt) {
return (
<main>
<h1>Confirm your email</h1>
<p>Check your inbox to unlock your position and referral link.</p>
<p className="text-muted">Signed up as {maskEmail(entry.email)}</p>
</main>
);
}
const position = await getEffectivePosition(entry);
const referrals = await countVerifiedReferrals(entry.id);
const shareUrl = buildReferralShareUrl(entry.referralCode);
return (
<main>
<h1>You are #{position} in line</h1>
{confirmed === "1" && <p role="status">Email confirmed. You are on the list.</p>}
<p>
{referrals === 0
? "Invite friends to move up when they join."
: `${referrals} friend${referrals === 1 ? "" : "s"} joined. Nice work.`}
</p>
<p className="text-sm text-muted">Account: {maskEmail(entry.email)}</p>
<ShareReferralLink url={shareUrl} code={entry.referralCode} />
</main>
);
}Gate logic matches article 02: no share link untilconfirmedAtwhen double opt-in is enabled.
Step 4: Copy-to-clipboard client component
app/status/share-referral-link.tsx:
"use client";
import { useState } from "react";
export function ShareReferralLink({ url, code }: { url: string; code: string }) {
const [copied, setCopied] = useState(false);
const shareText = `I'm on the waitlist. Join with my link and we both move up: ${url}`;
async function copyLink() {
try {
await navigator.clipboard.writeText(url);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
} catch {
/* fallback below */
}
}
return (
<section aria-labelledby="share-heading">
<h2 id="share-heading">Your referral link</h2>
<p><code className="break-all">{url}</code></p>
<button type="button" onClick={copyLink}>
{copied ? "Copied!" : "Copy link"}
</button>
<button
type="button"
onClick={() => navigator.clipboard.writeText(shareText)}
className="ml-2"
>
Copy message + link
</button>
<p className="text-sm">Code: <strong>{code}</strong></p>
</section>
);
}navigator.shareon mobile can wrap the sameshareTextwhennavigator.canShareis available. Optional enhancement.
Accessibility:Announce “Copied!” witharia-live="polite"on a status span. Ensure the copy button is reachable by keyboard; the referral URL in<code>should allow text selection for users who cannot use the clipboard API.
Branding:PassaccentColorfrom admin CMS later (Week 10); for now, match landing typography so the status page feels like the same product, not a generic receipt.
Step 5: Metadata and SEO for personal pages
Status URLs arepersonal, not landing SEO targets. Addrobots: noindexingenerateMetadata:
import type { Metadata } from "next";
export async function generateMetadata({ searchParams }: Props): Promise<Metadata> {
const { code } = await searchParams;
return {
title: code ? "Your waitlist status" : "Waitlist status",
robots: { index: false, follow: false },
openGraph: {
title: "Join the waitlist",
description: "Request access. Referral link inside after signup.",
// Do not leak queue position in OG for privacy
},
};
}Public marketing pages stay indexable;/statusshould not compete with your launch keyword.
Step 6: Post-signup redirect matrix
Align client redirects with API responses:
API response Redirect New signup, no opt-in/status?code=...New signup,pendingConfirmation/confirm/pendingDuplicate email, confirmed/status?code=...Duplicate email, unconfirmed/confirm/pendingor resend UI
Keepreferral attributionon signup only. The status page never accepts?ref=to change position (prevents confused users pasting the wrong link).
Email deep links:If users lose the tab, send them back via Resend templates that link to/status?code={referralCode}after confirm, not to the bare landing. That reduces support tickets asking “what was my rank?”
Leaderboard temptation:Resist shipping a public top-10 referrers on the status page in v1. It encourages disposable-email farms; if you add gamification, gate it behind admin moderation and verified referrals only.
Step 7: Security and privacy
No enumeration: “Not found” vs “confirm email” reveals whether a code exists; at small scale that is acceptable. For high profile launches, use signed tokens in the status URL instead of raw
referralCode(advanced).No leaderboard: showing top referrers gamifies abuse; if you add one later, rate-limit and verify emails.
HTTPS only: share links must be
https://in production env.
Pair withhoneypot and rate limitingon signup so status pages are not spammed by fabricated codes at scale.
Step 8: Test checklist
Sign up as User A: land on status; copy share URL; open in incognito with
?ref=on home.Sign up as User B via A’s link: after confirm (if enabled), A’s position improves on refresh.
Duplicate email: same
referralCode, same status page.Unconfirmed + double opt-in: status shows confirm message, no share URL.
NEXT_PUBLIC_APP_URL: share link domain matches production, notlocalhost.Lighthouse: status page should not load heavy client JS; copy button only is fine.
Screen reader: position reads as “You are number 42 in line”, not only “#42”.
Load testing:Position is computed on read (article 01). At tens of thousands of signups, indexreferredByIdandreferralCode; status page QPS spikes on launch day when users refresh obsessively. Consider shortunstable_cacheperreferralCodefor 30–60 seconds if DB pressure shows up in metrics.
Common failures
Share link showslocalhostor preview URL
Cause:MissingNEXT_PUBLIC_APP_URLin Vercel production.Fix:Set per environment; rebuild.
Position stuck after friend joined
Cause:Friend not confirmed under double opt-in; or counting unconfirmed referrals.Fix:AligncountVerifiedReferralswith article 01/02.
Users bookmark/statuswithoutcode
Cause:No default handling.Fix:Friendly error + link to landing join form.
Open Graph exposes exact queue rank
Cause:Putting#3inog:title.Fix:Generic OG copy; rank only in authenticated body.
Wrong ref in share URL
Cause:Usingidor email instead ofreferralCode.Fix:Always?ref=${entry.referralCode}.
Schema deep dive (companion)
Field-level detail onreferralCode,referredBy, and unique email lives in thePrisma waitlist model postin this series. The status page assumes those constraints already exist.
Treat the status page as the habit loop: users return to see progress, copy the link again after launch announcements, and forward it in DMs. Polish here has outsized growth impact relative to the lines of code required.
Personal status pages in the kit
Landing, signup, referrals, status, emails, and admin are one loop. Rebuilding the status UX is where many launches stall on “copy link” polish.
Launch Waitlist KitfromSkryptixincludes:
Personal status page with queue position and referral share link
Referral boosts, optional double opt-in, honeypot, and rate limiting
Admin signups, CSV export, webhooks, and embed form
Personal status pages with share links are part of Launch Waitlist Kit.Get it here.
FAQ
How do I build a waitlist status page in Next.js?
Create a Server Component route that loadsWaitlistEntrybyreferralCode, computes effective queue position frombasePositionand verified referrals, and renders a share URL pointing to/?ref=CODEusing a stableNEXT_PUBLIC_APP_URL.
What should the referral share link look like?
Use your production site origin plus?ref=and the user’sreferralCode, for examplehttps://yourproduct.com/?ref=a1b2c3d4. The landing page readsrefand passes it into the signup API.
Should the status page use query params or a dynamic route?
Both work. Query params (/status?code=) simplify redirects from client signupfetchresponses. Dynamic segments (/status/[code]) look cleaner in the address bar but need the same Prisma lookup.
Do I need double opt-in before showing the share link?
IfWAITLIST_DOUBLE_OPT_INis enabled, show a “confirm your email” state untilconfirmedAtis set so users do not share before they are verified members of the list.
Should waitlist status pages be indexed by Google?
Usually no. Addrobots: { index: false }because pages are personalized and thin content when indexed at scale.
How do I link to the status page from a confirmation email?
After double opt-in, includehttps://yourapp.com/status?code={referralCode}in the Resend template so users return to position and share link without searching their inbox for the original signup response.
Written by the team behind Skryptix. We build Launch Waitlist Kit so founders can focus on the launch, not waitlist infrastructure.
