Beta testing: Definition and how to conduct it effectively

A beta with hundreds of signups can teach you less than a small group completing the right tasks.
Your team invites a waitlist to try a new export feature. The dashboard shows strong interest, a few people say it looks great, and no major issue reaches the release channel. At launch, customers discover that large exports fail, shared-workspace permissions are confusing, and an old client cannot open the output.
The beta attracted people. It did not cover the workflows that determined whether the feature was ready.
Beta testing puts a usable prerelease product or feature into real users' environments to learn about reliability, usability, compatibility, and fit before broader release. A useful program connects specific uncertainties to participants, tasks, observations, and a decision. Access is only the beginning.
This guide walks through that program: define the questions, recruit for coverage, control delivery, collect actionable evidence, and decide whether to expand, revise, or stop. The examples use a collaborative export feature, but the same structure applies to a mobile app, developer tool, or new product workflow.
Define which uncertainty the beta should remove
Separate beta from the other tests around it
Beta testing complements earlier engineering validation. It does not replace unit tests, integration tests, security review, accessibility checks, or internal acceptance testing. Users should help you discover realistic conditions, not serve as the first defense against a known data-loss defect.
| Activity | Main question | Typical evidence |
|---|---|---|
| Internal QA or alpha | Does the implementation meet its requirements? | Reproducible test results and defect fixes |
| Beta program | Does a usable prerelease work in intended users' real workflows? | Observed tasks, issues, behavior, and feedback |
| Controlled rollout | Can exposure expand while operational risk is monitored? | Health signals, guardrails, and recovery checks |
| Randomized A/B test | What is the effect of assigning one experience rather than another? | Comparable assigned groups and outcome analysis |
Programs can overlap, but their evidence is not interchangeable. Enthusiastic beta comments do not establish conversion lift. A clean error dashboard does not establish that users understand the interface.
The meaning of beta also varies. Python's development cycle uses beta as a stage with restrictions on new features. A SaaS team may continue iterating substantially during its beta. State your actual change policy rather than assuming the label communicates it.
Turn a broad goal into answerable questions
“See whether people like exports” is too vague. A better brief identifies the uncertain workflow: can a workspace administrator export a large project, give the file to an analyst, and have that analyst use it without manual repair?
From that, define questions you can investigate. Can people find the action? Do permissions match expectations? Does the export contain the required fields? Does the file preserve characters and time zones? Does completion time remain acceptable on larger projects? Can users recover from failure without creating duplicate jobs?
Each question should have an evidence source. Task observation helps explain discoverability. Structured issue reports help reproduce failures. Telemetry shows job success and duration. Interviews explain whether the result fits the user's work. Avoid asking a single satisfaction score to answer all of them.
Choose private or public access deliberately
A closed beta admits a selected group. It is useful when you need specific roles, integrations, or environments and enough support capacity to follow up. An open beta lowers the admission barrier and may reveal a broader range of behavior, but it can also increase noise and operational load.
The GOV.UK beta delivery model illustrates a progression from private use toward a wider public service. The useful principle is staged learning and readiness, not a requirement that every commercial team copy the same phases.
For the export feature, start with organizations willing to share their workflow and report problems. Move toward broader opt-in access after the delivery path, support process, and most important coverage gaps have been exercised. “Public” should describe who can enter, not imply that the feature has finished learning.
Save a test brief that people can act on
Keep the beta brief short enough that engineering, support, research, and participants can work from the same scope. For the export example, the internal brief could contain these concrete entries:
- Decision: Determine whether the export workflow is ready for a broader opt-in release, with separate consideration of large-project eligibility.
- Participants: Workspace administrators and editors who already export project information, plus analysts who consume those files. Include the important supported environments and accessibility needs from the coverage matrix.
- Tasks: Export an existing project, open the output in the normal destination tool, verify the fields needed for reporting, and recover from one deliberately simulated failure in a controlled setting.
- Evidence: Task observations, export job events, completion and retry behavior, participant reports, downstream file checks, and the results of the recovery rehearsal.
- Owners: A program owner coordinates participation; an engineering owner handles defects and disablement; a researcher or product owner interprets workflow feedback; support knows the current build and limitations.
- Review trigger: Review after the important coverage paths have been exercised and the team has enough follow-up to assess the defined questions. Pause earlier for a critical defect or a recovery failure.
Add the specific build or configuration revision to each test round. If the team changes the output schema halfway through the program, distinguish evidence from before and after that change. Otherwise, a successful task on the old build can be mistaken for validation of the new one.
Give participants a simpler version focused on their task and what to report. Internal owners need issue severity and release criteria; a participant needs to know what they can try, what limitations apply, and where help is available. Both versions should describe the same feature scope.
Review the brief before recruiting. If a proposed activity does not answer one of its questions, decide whether it belongs in another research or engineering task. This keeps a beta from becoming an unfocused backlog of every feature request the team encounters. When new evidence changes the main question, update the brief openly and explain which earlier observations remain relevant.
Recruit people who cover the intended use
Define a coverage matrix before an invitation target
Choose participants based on the conditions that could change the result. For exports, role, project size, file destination, language, and integration path may matter more than total signup count.
| Coverage dimension | Example participants or tasks | What you need to learn |
|---|---|---|
| Role and permissions | Administrator, editor, read-only member | Who should see, start, and access an export |
| Workload | Small and large projects | Whether job size changes performance or reliability |
| Destination | Spreadsheet user, downstream analyst | Whether the output is usable after download |
| Environment | Supported browsers and client versions | Whether delivery and compatibility hold |
| Accessibility | Keyboard and assistive-technology workflows | Whether users can complete the whole task |
This is a planning matrix, not proof that every combination needs the same number of testers. Prioritize high-risk paths, important customer workflows, and conditions internal testing cannot reproduce well.
Recruit people with the actual problem. A founder's friends can identify obvious bugs, but they may not operate large shared workspaces or depend on the exported data. Research on sampling bias in entrepreneurial experiments is a useful reminder that an early test audience can differ systematically from the intended market.
Make participation easy to begin and useful to complete
Tell participants what is ready, what may change, what data the feature touches, how to report a problem, and how to leave. Give them a task that fits their own work rather than a long generic checklist.
An invitation for the export beta might say that the team wants feedback on exporting an existing project into the participant's normal analysis tool. It should identify known limitations and a support contact. Do not promise a migration path or release date the team has not committed to.
Use a short onboarding check: can the participant access the correct build, see the intended feature, and reach a realistic starting point? A broken invitation or missing permission can look like low product interest if you monitor only feature use.
If participants receive compensation, make it independent of positive feedback. Explain what participation involves and respect their time. Feedback becomes less useful when people feel they must praise the feature to remain in the program.
Track the participant funnel and the coverage gaps
Record invited, accepted, installed or enabled, attempted the target task, completed the task, and provided feedback. These stages answer different questions. A waitlist measures interest; task attempts show actual exposure to the workflow you need to evaluate.
Suppose 80 people accept, 25 attempt an export, and 4 report issues. You cannot conclude that the feature has a 5% issue rate by dividing 4 by 80. Many accepted participants never exercised it, and issue reporting is not complete observation of failure.
Follow up on missing coverage, including people who stopped early. A quiet participant may be busy, blocked, confused, or satisfied. Choose a small set of follow-up questions that distinguishes those possibilities. Keep observed behavior and inferred motivation separate in the program notes.
Keep beta access manageable
Connect cohort targeting with ownership, monitoring, and flag cleanup as your beta expands across teams and environments.
Explore Flag PracticesControl delivery and preserve a recovery path
Distribute the right build to the right group
Mobile and installed software need a distribution mechanism as well as an in-product access policy. Apple TestFlight provides beta builds, tester groups, and feedback workflows. External testing has platform review requirements, and builds have a testing lifecycle. Google Play's testing tracks distinguish internal, closed, and open distribution.
Use the platform's current documentation for requirements rather than assuming an invitation link grants immediate access. Test the joining experience with a fresh participant account. Confirm which build is installed and whether an older build remains active.
For web software, the deployed code may already be present for everyone while access is limited to a beta cohort. That can make iteration easier, but it still requires checking that the client and backend agree about eligibility and behavior.
Target the feature without turning the flag into authorization
Feature flags separate deployment from exposure. GrowthBook targeting conditions can use attributes supplied by your application to control which users receive a feature's behavior.
For the export beta, maintain an explicit membership attribute or reviewed cohort. Verify an included user, an excluded user, a recently removed user, and an account whose role changes. Check the backend operation as well as the visible button. Authorization must still enforce who can access or export data regardless of flag state.
Choose the assignment unit intentionally. If all members of a workspace share exported data and permissions, enabling entire accounts may be more coherent than enabling scattered individuals. Avoid a situation where an administrator creates an artifact that other members cannot interpret because they are on a different experience.
Test disablement and data compatibility before expanding
Define the fallback when the feature is disabled or configuration is unavailable. If an export job has already started, does it finish, cancel safely, or require operator action? Does removing beta access revoke downloads, and should it? Answer these questions as product and security decisions rather than leaving them to incidental implementation behavior.
A flag does not reverse every consequence. It cannot unsend an email, retract a downloaded file, or automatically undo a database migration. A new file format may need compatibility support after the interface is disabled. Plan data recovery and migration separately from exposure control.
Run a small recovery rehearsal. Disable the feature for the test cohort, verify the fallback, and inspect jobs already in progress. Record who can pause the program and who handles participant communication. Guardrail-monitored rollouts can support controlled expansion when configured, but operational recovery still needs engineering ownership.
Observe the workflow and turn reports into evidence
Give people realistic tasks without leading them
Ask a participant to accomplish a goal: prepare last month's project data for their normal reporting workflow. Let them choose the path before showing them where the export button lives. Record where they hesitate, what they expect, and whether the result actually works in the next tool.
Mix observation with independent use. A moderated session can explain a failure, but the team will not be present during ordinary work. A short follow-up after several real attempts can reveal whether the feature remained useful outside the session.
Follow the whole journey. A successful download is not the end if the analyst cannot interpret the columns. User research during beta emphasizes continued research as a service becomes real. Include support, accessibility, onboarding, and recovery in the journey rather than restricting the program to its happiest screen.
Collect enough context to reproduce a report
Give participants a simple reporting format: intended task, expected result, actual result, approximate time, build or version, relevant environment, and steps to reproduce. Offer a way to attach an image or diagnostic identifier without requesting secrets or unrelated customer data.
For exports, a report saying “it is slow” becomes more useful when it identifies the project size, job ID, elapsed time, and whether the file eventually completed. The team can then distinguish a queue delay from a failed download or an unclear progress indicator.
Keep a raw report and an engineering interpretation as separate fields. “I could not find the file” is an observation. “The job failed” is a hypothesis until logs or reproduction establish it. This distinction prevents the tracker from turning uncertain reports into confident root causes.
Combine qualitative reports with behavior and health metrics
Choose a focused set of metrics aligned to the beta questions. For the export feature, measure eligible task attempts, job completion, time to completion, retries, and downstream usability checks. Use error and latency signals for operational health, and track support demand so expansion does not overwhelm the team.
Document metric definitions, especially denominators. A 98% job completion rate differs from 98% of users completing their intended task. One user may retry several times. A successful job may produce a file they cannot use.
Positive survey responses are evidence of those respondents' perceptions. They are not a representative conversion estimate. A volunteer beta can reveal mechanisms and defects; a separately designed A/B experiment can estimate the effect of assigning a change among its eligible population. If both run during the same period, keep their cohorts, purposes, and reporting clear.
Triage by impact, then confirm the fix
Separate severe defects, workflow blockers, usability friction, and feature requests. Set severity from user impact and recoverability, not how loudly the report is written. Duplicate reports can indicate reach, but 1 credible report of data exposure can be more urgent than many requests for a cosmetic preference.
Assign an owner and a next action. Link a duplicate to the underlying issue while preserving affected versions and environments. If a fix changes behavior materially, tell participants which version to use and rerun the relevant task.
Close the loop with the reporter when practical. Ask whether the fix resolves the original problem, while also checking it with engineering evidence. A report marked closed because code merged is not the same as a participant successfully completing the repaired workflow.
Use explicit criteria to decide whether to expand
Write a decision brief that can survive a deadline
A beta should end with a decision about the next stage. Define entry and exit conditions before broad recruitment. Otherwise, a calendar deadline can become the only release criterion.
For the export example, the decision brief could require: the important role and workload paths exercised; no unresolved critical data-loss or access-control defect; large-project failures investigated; successful recovery rehearsal; support and documentation ready; and agreed operational thresholds observed for a meaningful period.
Those are illustrative criteria, not universal standards. Choose thresholds using existing reliability objectives, user needs, and the risk of the feature. A small number of volunteer tasks cannot establish a precise low failure rate, so include evidence limitations rather than treating an empty bug queue as certainty.
Keep unresolved issues visible. An accepted limitation should have a reason, owner, affected population, and mitigation. If the feature cannot yet serve large projects, consider a constrained release with an explicit limit, provided that constraint is technically enforced and honestly communicated.
Review a concrete release decision
Suppose administrators and editors complete the export flow, smaller jobs behave normally, and analysts can use the output. Large projects still show intermittent failures, and users cannot tell whether a retry creates a duplicate job. The feedback score is positive.
The right response is not to average those signals into a vague readiness rating. The unresolved failure and recovery behavior directly affect the promised workflow. Keep that workload restricted, repair the duplicate-job behavior, and rerun representative large-project tasks. If a smaller-scope release is useful, review it as a distinct decision with clear eligibility and limits.
Conversely, suppose the technical workflow is reliable but participants do not use the output in their reporting. That may be a fit problem rather than a defect. Interview participants about the destination workflow and reconsider the feature's value before expanding exposure simply because the software is stable.
Transition participants and keep monitoring
When moving beyond beta, explain what changes for participants: access, pricing if applicable, support, data retention, and known limitations. Remove obsolete invitations and update documentation. Follow the relevant platform process for replacing or retiring beta builds.
Expand deliberately and keep the recovery path available through the early release period. Monitor whether the broader population behaves differently from the selected beta cohort. New traffic can introduce older devices, larger workloads, different roles, and less motivated users.
Retain the evidence that led to the decision: participant coverage, tested versions, unresolved risks, key issue fixes, and monitoring plan. That record helps the next release avoid repeating the same uncertainty.
Make beta a reusable learning program
The durable output of beta testing is a clearer product and a stronger release decision. Signups, comments, and defect counts matter only in relation to the questions you set out to answer.
GrowthBook can support the access and measurement layer through targeted flags, shared metrics, and controlled rollouts. Your team supplies the participant research, support process, technical recovery, and judgment about readiness. Give those responsibilities named owners before the first invitation goes out.
Start the next beta with a short brief: the uncertain workflow, the people and environments you need, the evidence you will collect, and the decision that evidence will inform. Then verify that participants can actually reach the task. A well-run beta turns real use into actionable learning while the scope is still small enough to change.
Move from beta to measured release
Use GrowthBook to control feature exposure and connect release decisions with your team's existing data and metrics.
Get StartedFAQs
Alpha commonly emphasizes earlier internal validation, while beta puts a usable prerelease product or feature into selected users' real workflows. Teams use these labels differently, so define the readiness criteria and participant scope for your program.
Choose coverage and participation based on the questions and risks you need to investigate. A qualitative beta does not have a universal sample-size requirement, and a causal experiment needs a separate power and assignment design.
Invite-only access helps you control coverage and support load, while an open beta can reveal a broader range of environments and behaviors. Expand only when delivery, monitoring, support, and recovery are ready.
Targeting conditions can select cohorts using attributes your application supplies. Keep authorization separate, verify both included and excluded users, and maintain a safe fallback for disabled or unavailable features.
No. Volunteer feedback can reveal usability and reliability problems but does not isolate causal impact. Use a properly designed experiment when the question requires a comparison of outcomes.
Related Articles
A magazine's home page shows two recent issues. The design team wants subscribers to try a shelf with four. All four covers are public, and changing editions while the page is open should update the shelf immediately. That gives you a small React feature with a useful acceptance test. Click from guest to subscriber and back, and count the covers each time.
We'll put the display limit in a typed local flag, evaluate it inside a React component, and leave the choice of edition with the app. The example runs in a client-rendered React app without a GrowthBook account, an SDK key, or a request for flag rules. For the wider workflow, free feature flags for coding agents explains what to ask an agent to implement and how to review the result.
Define what one flag controls
Start with an existing React and TypeScript app, or create a Vite React project for the example. Install both GrowthBook packages so the definitions and the hooks resolve against compatible SDK versions.
Create src/flags.ts. Here the feature value is a number, which lets the component use the same rendering code for either edition. A future change from four covers to three is one edit to the rule.
A guest falls through to the default of two. A subscriber matches the rule and gets four. This rule applies to every subscriber, so the ID has no effect on the result here. If you later roll the shelf out to a percentage of subscribers, you already have an identity to use for repeatable assignment.
The type registration release note explains the version requirement for LocalFeatures. The registration connects the definition, the attributes, and the value returned by the hook. For the TypeScript mechanics, see Jeremy Dorn's Register pattern walkthrough.
Put the current reader above the shelf
Replace src/App.tsx with the component below. The edition switch is a local fixture so anyone reviewing the change can reproduce both states. In an existing app, take those two values from the active reader in your session layer.
The provider receives an instance initialized with the current reader and the checked-in rules. React can render the correct shelf on the first pass for that reader. If the app is still loading a session, decide what should occupy the shelf in the meantime. For this public list a two-cover guest view is reasonable. On a page where a switch would interrupt the reader, wait for the session before mounting the shelf.
Give your agent the React setup
Use the local flags guide to ask for a typed definition, a provider with the current reader, and a test that changes the edition.
Open the Agent GuideThe useMemo dependencies include the ID and the edition. If a reader subscribes while signed in, their ID can stay the same while their edition changes. Depending only on the ID would leave the old SDK instance in place. Passing a fresh object as the dependency on every render would create unnecessary instances. The example uses the two primitive values the rule setup actually needs.
Read the numeric flag where React renders the list
Create src/IssueShelf.tsx. Keep one stable ID per issue and let the component use the resolved value to select how many items to render.
Keep the hook at the top of the component, inside the provider's subtree. The React SDK supplies the flag value through that provider. Calling a hook inside a click handler or inside the list loop would break the Rules of Hooks. Use the returned number in ordinary render logic.
There are two places you can see the number two in this implementation. The definition's defaultValue is what an ordinary guest gets through evaluation. The 2 passed to the hook is a fallback for a value the SDK can't supply. Giving them the same value makes the basic shelf a sensible fallback, but checking only the guest case would let a broken provider arrangement or missing definition go unnoticed. The subscriber case proves that the component actually received the rule.
The list keys identify magazine issues. Keep those keys independent of the flag. Switching from two covers to four should preserve the identity of the first two rows. There's also no need to remount the whole app with an edition-specific key. React preserves state according to component position and keys. For example, a search input outside the shelf shouldn't lose its text because someone subscribed.
Check the transition in both directions
Use the template's build script to type-check and bundle the app. Once that passes, start the dev server and open the local address it prints.
On first load, the page says guest and lists November and October. Click Switch edition. The same page should say subscriber and add September and August. Click again. The list should return to the original two issues, in order. This last check catches code that appends more results on upgrade and never removes them on downgrade.
For a compile-time check, temporarily replace the numeric fallback with the string "2". Run the build again and inspect the error on the hook call. Then restore 2 and rebuild. If the string compiles, check that src/flags.ts belongs to the same TypeScript project as the component and that the package manager resolved compatible core and React versions.
Look for the core package used by your app and by the wrapper. If the app has several incompatible installations, align the versions before diagnosing the JSX. A team using an existing build script should also confirm it actually runs the TypeScript checker.
Hand off a React change someone can review
Give your coding agent the one-shot local feature flags guide and a short description of the observable behavior. For this shelf, the request can be as specific as the test.
The shelf controls how many public titles to display. If your actual feature unlocks paid articles, enforce access when the server serves an article. A client-rendered flag only decides what to show in that browser. Whenever a change to the display limit can wait for a deployment, the small local file keeps the decision reviewable alongside the component. When an editor needs to change it between issues without an engineering release, compare the free GrowthBook options for managing flag rules.
Manage the shelf in GrowthBook
Start a GrowthBook workspace when your magazine team is ready to manage shelf rules between deployments.
Get Started with GrowthBookTwo customers download the same weekly report. One has agreed to preview a new CSV column. The other feeds the old two-column format into an importer. Both requests can land on the same Node.js process, and each needs the right file even if the other request arrives while the report is loading.
This tutorial builds that endpoint with one checked-in feature flag. The process loads the rules once. Each request supplies its own workspace attributes and receives its own evaluation. You can run the whole example on your machine without an account, a client key, or a flag server. The free feature flags for coding agents walkthrough introduces the local approach. Here we'll give the agent a server-specific test to pass.
Set up a small TypeScript service
Use Node.js 22 or newer for this example. In an empty directory, create an npm project that uses ES modules, install the core SDK, and add the TypeScript tools.
Create tsconfig.json at the project root. The sample runs TypeScript directly with tsx and checks types in a separate step. Type checking with tsx explains why the two commands serve different purposes.
The following files all live next to that configuration. The server imports ./flags.js even though the source file is flags.ts. That spelling follows TypeScript's Node.js module resolution for ESM and works with this runner.
Define the report contract in one flag
Create flags.ts. The public format has two columns. The sample preview workspace gets one additional column. The only targeting attribute the rule needs today is reportPreview. Carry the workspace ID too, so two people downloading a report on behalf of the same workspace can share an assignment if you introduce a percentage rollout later.
The SDK type registration update covers this rule syntax and the 2.2.0 minimum. If you misspell reportPreview in a condition or use a string where the boolean flag expects a value, TypeScript can point at the definition. The Register pattern also makes the same feature name available in other modules without threading a generic type through each handler.
Before you add the endpoint, decide what belongs to the process and what belongs to the request. The feature definitions are identical for both customers. Their identity and preview enrollment can differ. If a handler changes an attribute on a single shared user instance before awaiting a database query, another handler could replace that attribute before the first handler resumes.
Give your agent a server-side task
Use the one-shot guide to add checked-in rules. Ask your agent to keep workspace attributes local to each request and demonstrate both CSV formats.
Open the Local Flags GuideCreate a scope when the request arrives
Create server.ts. The Node.js SDK provides GrowthBookClient for the process and createScopedInstance for the current request. The two fixture paths below stand in for two authenticated workspaces. The server binds to the loopback address so you can exercise it locally.
The HTTP handler looks up a workspace, creates its scope, and holds that scope across an asynchronous operation. The short promise-based timer gives a second request time to arrive. In a real export, that's where the database or storage read would happen. Keep the stable client at module scope and the scoped instance inside the handler. If a formatter needs the decision, pass it the boolean or the scoped instance.
In production, resolve the workspace and its access rights from the authenticated session before reading the report. The two selectable paths here are fixtures for public sample data. A caller's choice of a header, query string, or workspace slug can't establish permission to read another customer's report. The endpoint also prevents shared response caching. If you cache real exports, the cache needs to distinguish the workspace and the report format, along with any other inputs that change the response.
Test two requests that overlap
In the first terminal, type-check the service and start it. A successful type check exits quietly. The next command prints the loopback address and keeps the server running.
Save the following as verify.mjs. In a second terminal, run node verify.mjs. Node's built-in fetch calls the local server. Strict assertions compare the full header and data row, including where each row ends.
You should see the single success line. Testing just the preview workspace proves that the code can add a column. Testing both responses catches the more expensive mistake of silently changing an existing customer's export. Keeping the old format assertion around is especially valuable when the downstream importer belongs to someone outside your team.
To check the compile-time boundary, temporarily change gb.isOn("includeUniqueReaders") to gb.isOn("includeUniqueReader") and rerun npx tsc --noEmit. The diagnostic should identify the misspelled key. Restore it before running the server again. A coding agent can include the before-and-after type check and the two CSV headers in its pull request.
Decide when to expand the report
When one preview customer is ready, leave everyone else on the default. If the next step is to enroll a fraction of workspaces, choose an attribute that matches the promise you're making. Hashing a workspace ID lets colleagues downloading the same report share a format. Hashing each user's ID could give two analysts in the same company different column sets. The one-shot guide shows how to express a percentage and hash attribute in a local rule.
A new rule in flags.ts reaches a process through your deployment. During a rolling deploy, the same workspace might hit old and new processes. If customers need a durable choice of export schema, keep supporting the agreed format in the API itself. When the operational requirement is to change targeting between deploys, you can keep the scoped evaluation in the handler and change how the process receives its rules. The free GrowthBook offerings overview covers Cloud Starter and self-hosting for teams that want to manage those rules.
Manage report targeting in Cloud
Create a GrowthBook workspace when the team supporting exports needs to expand the preview independently of a server release.
Get Started with GrowthBookYour conference agenda has a new “Show room” button. Reviewers should see it on the first page load. Everyone else should get the existing agenda. If a Server Component renders the old agenda and a browser hook independently decides to show the new button, the first HTML and the browser can disagree.
In the Next.js App Router, the server can make this decision once and pass a boolean to the interactive component. We'll define the flag in the repo, select the preview audience with a local test cookie, and verify the actual HTML for both visitors. Clicking the button will still work after hydration. You can follow along without a GrowthBook account or client key. If you're assigning this work to an agent, the free feature flags for coding agents walkthrough gives the background.
Keep the flag definitions on the server
Use a TypeScript App Router project, or create a small one with create-next-app. These paths assume the project has an app directory at its root. If yours uses src/app, put both app and lib under src so the relative imports still match.
Keep the starter's root layout. Create lib/agenda-flags.ts with the following code. The SDK type registration update explains how LocalFeatures checks the flag and its rule against the registered types. This setup requires version 2.2.0 or later.
The module can reuse the client and rules across requests handled by the same process. It only holds the current visitor's audience inside the function call. Two requests can therefore use the same flag file and get different results. The Node.js SDK documents the scoped client used under the App Router here.
This particular rule has no percentage and needs no visitor ID. The two audiences are sufficient. If the team later asks for a rollout to 10% of attendees, add a stable attendee or registration ID and choose which of those units should stay together. Jeremy Dorn's Register pattern article explains how a change to an attribute type reaches the call sites that construct it.
Read the cookie for this request
Create app/agenda/page.tsx. The static heading can render for everyone. The request-specific content sits behind a Suspense boundary, so the fallback can show a neutral loading message until the server has the cookie.
The App Router's cookies function reads the incoming request asynchronously. Read it inside the visitor-specific component. Keeping that read out of shared cached code lets the surrounding page reuse common content without treating one visitor's decision as another's. This placement also accommodates App Router projects using Cache Components.
Give your agent the Next.js setup
Use the local flags guide with a concrete request to evaluate one flag on the server and return the same decision to the browser.
Open the Local Flags GuideThe cookie in this demo is a convenient way to preview a public UI treatment. Anyone with that cookie can see the room label. To target paying attendees or private sessions, obtain the audience from the verified session on the server and authorize the underlying data separately.
Pass one decision to the interactive component
Create app/agenda/Agenda.tsx. It's a Client Component because a visitor can open and close the room details. Its initial branch comes directly from the boolean supplied by the page.
The client boundary takes a serializable prop. The component receives true or false. The SDK instance, targeting rules, and cookie handling stay in the server module. You don't need a React provider for this component because its only browser-side choice is whether the visitor has clicked the button.
Follow one page load through server rendering and hydration. For a preview visitor, the server can send a section with a “Show room” button. React's first client render gets the same showRoom value and starts with open set to false. Hydration attaches the click handler. Opening the room detail then updates component state and doesn't require another flag evaluation.
Verify the HTML and the click separately
Build the production app and start it on port 3100.
In a second terminal, save this as verify-agenda.mjs in the project root and run node verify-agenda.mjs. The test makes two requests to the same route and looks for a marker on the rendered section. A marker in the HTML helps catch an implementation that only adds the intended layout after JavaScript runs.
Now open http://localhost:3100/agenda in a fresh browser profile. You should see the session title without a room button. In that local page's browser console, set the demo cookie and reload.
Click Show room and look for Room 204. Click Hide room and the room should disappear. This second check proves the component became interactive. If the server response test passes but the click fails, inspect the browser console for a hydration error before changing the flag rules.
Remove the fixture and reload once more. The button should disappear and the agenda title should remain.
The reload is deliberate. Editing the cookie in an already open document doesn't rerun its Server Component. In your app, use the normal session-change flow to request a fresh server render when a visitor signs in, signs out, or leaves a preview group.
Choose where the next flag should be evaluated
For a decision needed in the initial HTML, give the agent an observable requirement. Ask it to show the two HTTP responses, then click the interactive control in the preview. The first check catches an incorrect layout. The second catches correct HTML that never becomes interactive.
If a later feature depends on an action entirely within the browser, evaluate whether its flag belongs in the client tree. The one-shot local flags guide covers both placements. This agenda only needs one server decision. Updating its checked-in rule takes a deployment. Keep that tradeoff in view if the event organizer needs to pause a preview while attendees are already arriving. For that case, compare GrowthBook’s free options for changing flags between deploys.
Manage the agenda rollout in Cloud
Create a GrowthBook workspace when the organizer needs to adjust a preview audience while your Next.js app is serving attendees.
Get Started with GrowthBookReady to ship faster?
No credit card required. Start with feature flags, experimentation, and product analytics—free.




