For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Sign inTry it free
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
DocsGuidesSDKsIntegrationsAPI docsTutorialsFlagship blog
  • Tutorials
    • The AI Iteration Loop for Deploying Reliable Agents with LangGraph
    • Using LaunchDarkly feature flags and Experimentation with Wordpress
    • Migrate a Hardcoded LangGraph Agent to LaunchDarkly AgentControl in 20 Minutes
    • Offline Evaluation of RAG-Grounded Answers in AgentControl
    • Beyond n8n for Workflow Automation: Agent Graphs as Your Universal Agent Harness
    • Catch your first silent AI failure with Vega AI in under 10 minutes
    • Evaluate LLM code generation with LLM-as-judge evaluators
    • OpenTelemetry for LLM Applications: A Practical Guide with LaunchDarkly and Langfuse
    • Use LaunchDarkly Agent Skills in Claude Code and Cursor
    • Detection to Resolution: Real World Debugging with Rage Clicks and Session Replay
    • Compare AI orchestrators: LangGraph vs Strands vs OpenAI Swarm
    • Building a data extraction pipeline with LaunchDarkly
    • Day 12 | 🎊 New Year, New Observability
    • Day 11 | ✉️ Letters to Santa: What engineering teams really want from Observability in 2026
    • Day 10 | Why observability and feature flags go together like milk and cookies
    • Day 9 | 👻 The Three Ghosts Haunting Your AI This Holiday Season
    • Day 7 | 🎄✨The Rockefeller tree in NYC: SLOs that actually drive decisions
    • Day 6 | 💸 The famous green character that stole your cloud budget: the cardinality problem
    • Day 5 | 🧹 Using a Popular Tidying Method to Consolidate Your Observability Stack
    • Day 4 | ❄️ Tracing the impact of holiday styling in your Node.js app
    • Day 8 | 🎁 Observable Multi-Modal Agentic Systems
    • Day 3 | 🔔 Jingle All the Way to Zero-Config Observability
    • Day 2 | 🎅 He knows if you have been bad or good... But what if he gets it wrong?
    • Collecting user feedback in your app with feature flags
    • Day 1 | 🎄 Observability Under the Tree: What Changed in 2025
    • Build a User Frustration Detection & Response System
    • When to Add Online Evals to Your AgentControl
    • Detecting User Frustration: Understanding Rage Clicks and Session Replay
    • AgentControl config CI/CD Pipeline: Automated Quality Gates and Safe Deployment
    • A Deeper Look at LaunchDarkly Architecture: More than Feature Flags
    • Add Observability to Your React Native App in 5 minutes
    • Smart AI Agent Targeting with MCP Tools
    • Build a LangGraph Multi-Agent System in 20 Minutes with LaunchDarkly AgentControl
    • Snowflake Cortex Completion API + LaunchDarkly SDK Integration
    • Using AgentControl to review database changes
    • How to implement WebSockets and kill switches in a Python application
    • 4 hacks to turbocharge your Cursor productivity
    • Create a feature flag in your IDE in 5 minutes with LaunchDarkly's MCP server
    • Observability for Your Go ORM: OpenTelemetry Integration with GORM
    • The complete guide to OpenTelemetry in Next.js
    • How to instrument your React Native app with OpenTelemetry
    • The complete guide to OpenTelemetry in Python
    • Monitoring Browser Applications with OpenTelemetry
    • How to Use OpenTelemetry to Monitor Next.js Applications
    • What is OpenTelemetry and Why Should I Care?
    • Distributed Tracing in Next.js Apps
    • Tracing Distributed Systems in Next.js
    • Real-time Monitoring in Django: Essential Tools and Techniques
    • DeepSeek vs Qwen: local model showdown featuring LaunchDarkly AgentControl
    • Application Tracing in .NET for Performance Monitoring
    • The Ultimate Guide to Ruby Logging: Best Libraries and Practices
    • Using Materialized Views in ClickHouse (vs. Postgres)
    • Filtering and Sampling LaunchDarkly Ingest
    • How to Set Up Your Production AWS MSK Kafka Cluster
    • Publishing an NPM Package with Private pnpm Monorepo Dependencies
    • How To Use The Chrome Inspector & Debugger
    • 3 Levels of Data Validation in a Full Stack Application With React
    • The power of the monorepo: Keep your fullstack app in sync!
    • Compression: The simple, powerful upgrade for your web stack
    • Video tutorials
Sign inTry it free
LogoLogo
On this page
  • Why you should think about this today
  • Requirements
  • Create the feature flag
  • Install the SDK and implement user feedback function
  • Create the feedback modal file
  • Enable the client SDK in production environments
  • Test out the user feedback function
  • Run flag evaluations
  • Assess the user feedback on dashboard
  • Create different sessions and customize user behavior
  • Observe the session replay
  • What’s next for collecting metrics and user feedback?
Tutorials

Collecting user feedback in your app with feature flags

Was this page helpful?
Previous

Day 1 | 🎄 Observability under the Tree: What Changed in 2025

Next
Built with

Published December 9th, 2025

Portrait of Diane Phan.

by Diane Phan, Developer Educator at LaunchDarkly

If you’re a builder, you understand that it’s crucial to observe how users respond to new features, interface changes, and experimental variations.

Feedback is an essential part of the product development lifecycle, helping teams validate decisions and iterate faster. The new user feedback tool makes it convenient and possible for you and your team to enable metric tracking for specific feature flags within minutes.

This tutorial will guide you to enable and view valuable user feedback metrics directly from the LaunchDarkly dashboard. A sample app will be provided for you to clone and follow along on your own machine, but you can skip over to the “Install the SDK and implement user feedback function” if you prefer to use your own app. This features is available for JavaScript & TypeScript client-side SDKs. React components are also provided for convenient integration.

Why you should think about this today

Learning how to track important metrics such as user feedback is often overlooked. It can also be a struggle to connect user sentiment directly to a feature flag or existing experimentation.

Perhaps your problem might be relying on generic feedback tools that lack context about which features users are experiencing. Ideally you would want to see a list of feedback tied to a feature that has been shipped behind a flag.

Don’t spend more time guessing where a user dropped off when this new LaunchDarkly feature can provide more contextual feedback and live session replay. The qualitative feedback helps narrow down the decision making process so that your team can ship features faster, catch issues early, or roll back a variation and adjust a specific prompt. It is also a great way to understand how different users behave - whether you’re working with gamers, beta testers, premium users, or internal users.

Requirements

  • LaunchDarkly account. If you haven’t done so already, create a free account
  • An app that uses client side flags. A sample app will be provided below
  • Modern node version. I would recommend the node version manager (nvm) if you don’t have node installed already
  • Bonus: LaunchDarkly feature flags set up and enabled already

If you would like to follow along with this tutorial with our starter code, go ahead and clone this project:

$git clone git@github.com:launchdarkly-labs/ld-feedback-tutorial.git

Create the feature flag

If you and your team do not have an existing feature flag already, go to the LaunchDarkly dashboard and create your first feature flag. Give it a name such as “feedback demo”.

Create a new flag named "feedback
demo"

Create a new flag named feedback demo.

You will be directed to the dashboard to configure and toggle your flag ON. After you’ve done so, head back to your developer environment. Make an .env file using the command cp .env.example .env and add the following lines:

$VITE_LAUNCHDARKLY_CLIENT_SIDE_ID=XXXXXXXX
$VITE_OBSERVABILITY_PROJECT_ID=”<YOUR_PROJECT_NAME_ON_LAUNCHDARKLY>”

Be sure to replace the values above with the project name on the LaunchDarkly dashboard and the client-side ID from the Test environment, as seen in the screenshot below.

Locate values for the .env file.

Locate values for the .env file.

Install the SDK and implement user feedback function

Click on the Feedback section at the top of the page.

Click on the Feedback tab at the
top.

Click on the Feedback tab at the top.

Click on View setup guide button to find the SDK to copy and paste for your project.

Screenshot of the feedback setup guide
SDK.

Screenshot of the feedback setup guide SDK.

In order to keep your working directory organized, make a new file named sendFeedback.ts in the src subdirectory. Copy and paste the SDK from the feedback setup guide to this new file.

This module sends the user feedback to LaunchDarkly using the client side SDK. The LaunchDarkly client then tracks these events for the developer to analyze relevant data such as sentiment, feedback, prompt, and user’s session data.

Create the feedback modal file

Here’s the fun part - implementing the buttons and functions necessary to collect feedback from users.

Create a new file within the src subdirectory and name it feedbackPopover.tsx.

Click on the React examples tab of the setup guide to access the code snippet. This tutorial will implement a feedback popover that allows users to type in a message and provide a thumbs up or thumbs down to describe their experience.

Let’s alter the FeedbackPopover function a bit. Scroll down to function and add an export keyword in the beginning so that function can be executed in the main application.

1export function FeedbackPopover({
2 flagKey = "feedback-demo",
3 ldClient,
4}

Navigate back to the app.tsx file to import the newly created file:

1import { FeedbackPopover } from './feedbackPopover.tsx'

Notice the comment for the FeedbackPopover component that utilizes the ldClient. Copy the <FeedbackPopover ldClient={ldClient} /> line and scroll down to the bottom of the page where the code returns JSX. Replace the placeholder comment {/* Add the feedback here */} with the FeedbackPopover class so it looks like the code snippet below:

1return (
2 <>
3 ...
4 <div>
5 <h2>Send Feedback Below</h2>
6 <div>
7 <FeedbackPopover ldClient={client} />
8 </div>
9 </div>
10 </>
11);

Great! Now the FeedbackPopover button will appear on the website. This feedback widget can be customized later on so that you can collect user feedback tied to feature flag variations.

This React file defines reusable, stateless icon components. The feedback function visibility is controlled by the isOpen prop. The user’s feedback is stored, and a sentiment is determined accordingly, and no input validation is required.

Enable the client SDK in production environments

If you are working in the Production environment, you might be prompted to enable the JavaScript Client SDK to access the flag’s key.

You can toggle this on and off in the flag’s dashboard in the bottom right hand corner under the Advanced controls section.

Advanced controls on the bottom right hand side to enable client-side
SDKs.

Advanced controls on the bottom right hand side to enable client-side SDKs.

Test out the user feedback function

Open up a terminal window and install the dependencies in the working directory with npm i. Run the dev server with npm run dev.

You should get output like this:

$ VITE v6.0.11 ready in 413 ms
$
$ ➜ Local: http://localhost:5173/
$ ➜ Network: use --host to expose
$ ➜ press h + enter to show help

Open up the http://localhost:5173/ page to see the following screen:

Demo page for
tutorial.

Demo page for tutorial.

Run flag evaluations

The starter code is presented to you so all you have to do is try it out! If you named your flag “feedback demo”, the flag key here should already be set. If not, you’ll want to change this code to reflect your flag key name.

Click the Feedback button and add some sample data to make sure the app is working. I’ll make 3 evaluations to populate the flag with data to examine.

Wait a minute before you can see your evaluation and feedback results in the dashboard.

Assess the user feedback on dashboard

Confirm that the feedback went through. Go back to the Feedback dashboard and refresh the page. See the latest comment that was created and how the sentiment was analyzed.

Assess the feedback on the
dashboard.

Assess the feedback on the dashboard.

To see the evaluations, switch over to the Audience tab.

View the audience dashboard in the feedback
demo.

View the audience dashboard in the feedback demo.

The nifty part of this new feature is examining the data. LaunchDarkly allows you to filter by sentiments, variations, and a specific timeframe.

However, filtering by different dates will only apply to the variations statistics in the chart above and the table below.

Data regarding the sentiment distribution and valuations are only shown in the table.

Go ahead and play around with the dashboard to filter the data accordingly to the project’s needs.

Create different sessions and customize user behavior

Every project has a different use case - perhaps your audience plays video games, or they are a subscribing member. You can create different contexts and customize them specifically for your use case.

LaunchDarkly also allows you to create different sessions to observe the user’s behavior.

Click on a user key and see the user context.

View the details for the user-2 context on the feedback
demo.

View the details for the user-2 context on the feedback demo.

Observe the session replay

If you have observability enabled, then you can see how the person interacts with your website and watch them enter the feedback. Click on the blue play button under the “Session” column and observe how the user interacts with the website before sending in a comment for feedback evaluation.

What’s next for collecting metrics and user feedback?

Congratulations on taking the next step in building more informed, user-driven experiences. The built in qualitative user feedback tool allows you and your team to quickly and conveniently enable and track metrics for specific feature flags without interrupting your development process.

Now, every feature rollout can capture both measurable impact and meaningful user sentiment, helping your team make faster, smarter decisions backed by real insight. It’s time to formulate better questions to learn from these new features.

Send me an email at dphan@launchdarkly.com, connect with me on LinkedIn, or follow @diane.dot.dev on social media to let us know what you’re building.