The surveys module lets you collect user feedback through in-app surveys. Surveys can trigger automatically based on events or be presented manually.
Present a Survey Manually
const presented = await AppDNA.surveys.present("nps_q1_2026");
if (!presented) {
console.log("Survey not found or already completed");
}
Module Access
const surveys = AppDNA.surveys;
Module Methods
| Method | Signature | Description |
|---|
present | present(surveyId: string): Promise<boolean> | Present a survey manually |
promptReview | promptReview(): Promise<void> | Start the smart review prompting flow |
8 Question Types
| Type | Display | Response |
|---|
nps | 0-10 numeric scale | Integer 0-10 |
csat | 1-5 satisfaction scale | Integer 1-5 |
rating | Star rating | Integer 1-5 |
emoji_scale | Emoji options | Selected emoji value |
yes_no | Binary choice | Boolean |
single_choice | Radio button options | Selected option string |
multi_choice | Checkbox options | Array of selected strings |
free_text | Text input field | Free-form string |
Smart Review Prompting
A two-step flow that routes happy users to the native store review dialog and unhappy users to a feedback form:
- In-app question: “Do you enjoy using [app]?”
- Positive — shows App Store / Play Store review dialog
- Negative — shows a free-text feedback form
await AppDNA.surveys.promptReview();
Rate-limited: maximum 3 times per year, at least 90 days apart. The SDK enforces these limits automatically.
Event Listeners
const unsubPresented = AppDNA.surveys.onPresented((surveyId: string) => {
console.log(`Survey shown: ${surveyId}`);
});
const unsubResponse = AppDNA.surveys.onResponseSubmitted(
(surveyId: string, responses: SurveyAnswer[]) => {
for (const answer of responses) {
if (answer.question_type === "nps") {
const score = answer.numeric_value ?? 0;
if (score >= 9) showReferralPrompt();
else if (score <= 6) showSupportLink();
}
}
}
);
const unsubDismissed = AppDNA.surveys.onDismissed((surveyId: string) => {
console.log(`Survey dismissed: ${surveyId}`);
});
// Clean up
unsubPresented();
unsubResponse();
unsubDismissed();
SurveyAnswer
| Property | Type | Description |
|---|
question_id | string | Identifier for the question |
question_type | string | Question type |
string_value | string | null | Text response |
numeric_value | number | null | Numeric response |
array_value | string[] | null | Multi-select response |
bool_value | boolean | null | Boolean response |
Auto-Tracked Events
| Event | Trigger |
|---|
survey_presented | A survey is displayed |
survey_response_submitted | User submits a survey response |
survey_dismissed | Survey is closed without completing |
Full Example
import { AppDNA, SurveyAnswer } from "@appdna/react-native-sdk";
import React, { useEffect } from "react";
import { Button } from "react-native";
function FeedbackScreen() {
useEffect(() => {
const unsubResponse = AppDNA.surveys.onResponseSubmitted(
(surveyId: string, responses: SurveyAnswer[]) => {
const nps = responses.find((a) => a.question_type === "nps");
const score = nps?.numeric_value ?? 0;
if (score >= 9) showReferralPrompt();
else if (score <= 6) showSupportLink();
}
);
return () => unsubResponse();
}, []);
async function askForFeedback() {
await AppDNA.surveys.present("nps_q1_2026");
}
async function promptForReview() {
await AppDNA.surveys.promptReview();
}
return (
<>
<Button title="Give Feedback" onPress={askForFeedback} />
<Button title="Rate Us" onPress={promptForReview} />
</>
);
}
Surveys are created in the Console under Feedback > Surveys. Trigger-based surveys appear automatically — use present() for precise control over timing.