Using the In-App SDK
Updated
The SDK for In-App Surveys allows brands to seamlessly integrate solicited feedback collection into their mobile apps during key customer interactions. Surveys can be triggered based on predefined conditions such as browsing behavior, session duration, or through custom events to capture targeted feedback. Once the SDK is set up, all survey creation and management can be handled directly within Sprinklr, with no further development required.
Please consult the article on Introduction to In-App Surveys for additional information regarding use cases and benefits.
Business Use Cases
Profile Authentication: Identifies the survey respondent as a known authenticated profile and links survey activity to the correct customer/user record.
User Context: Adds profile-level attributes that can be used for targeting, segmentation, and analytics across the user journey.
Survey Response Context: Adds response-level metadata for the current survey interaction, making each response more actionable in reporting.
Locale / Translations: Ensures you see surveys in the right language during initialization or after the app language changes.
This feature simplifies the integration of in‑app surveys, significantly reducing development time and effort while enabling real‑time user feedback collection to quickly identify issues and areas for improvement. With only a one‑time SDK setup required, all subsequent survey creation and management can be handled entirely within Sprinklr, eliminating the need for additional development and streamlining the overall workflow.
Installing the SDK
Before installing the SDK, ensure you have access to In-App Distribution in Customer Feedback Management (CFM) and collect the following details.
Prerequisites
This module is generally available as part of CFM In-App Surveys. To enable CFM, follow the setup instructions outlined in the CFM enablement documentation.
SDK support is currently available for Android, iOS, Flutter, and React Native.
Granular permissions are planned for additional areas, including Builder, Translations, Distribution, Responses & Analytics, and Settings.
Setting Up SDK Support for In-Apps
Use the SDK methods below to configure profile authentication, user context, survey response context, and locale handling. Please also go through the developer documentation for more details.
Profile Authentication
Profile authentication lets the SDK identify the respondent as a known user profile. Use it when the app already has an authenticated user and survey responses should be linked to that profile.
User Context
User context adds profile-level custom fields for segmentation, targeting, and analytics. The context shape is a map from custom field ID to a list of values.
{ "_c_69a26fe929147f2bed8c7452": ["Maruti", "Hyundai"] }
Locale / Translations
Locale support lets the SDK load the correct translated survey experience. Set locale during initialization or update it when the app language changes.
Events reference
Event | Payload |
UPDATE_USER_SUCCESS | { "userId": "" } |
UPDATE_USER_FAILED | { "userId": "" } |
UPDATE_USER_CONTEXT_SUCCESS | { "userId": "" } |
UPDATE_USER_CONTEXT_FAILED | { "userId": "" } |
LOGOUT_SUCCESS | {} |
LOGOUT_FAILED | { "error": "" } |
UPDATE_LOCALE_SUCCESS | { "locale": "" } |
UPDATE_LOCALE_FAILED | { "reason": "", "locale": "", "message": "" } |
UPDATE_SURVEY_RESPONSE_CONTEXT_SUCCESS | {} |
UPDATE_SURVEY_RESPONSE_CONTEXT_FAILED | { "message": "" } |
CLEAR_SURVEY_RESPONSE_CONTEXT_SUCCESS | {} |
CLEAR_SURVEY_RESPONSE_CONTEXT_FAILED | { "message": "" } |
Developer portal pages to update
Platform | Developer portal page | Updates required |
Android | Add user type, user context, locale, methods, and events. | |
iOS | Add user type, user context, locale, methods, and events. | |
Flutter | Add user type, user context, locale, methods, and events. | |
React Native | Add user type, user context, locale, methods, and events. |
Testing the feature
Initialize the SDK on the supported platform using the relevant app ID, environment, and device ID.
Validate profile authentication by initializing or updating a known user and checking whether survey activity is linked to the intended profile.
Pass user context and survey response context, trigger a survey, and verify that the metadata is available for targeting, segmentation, and reporting.
Update the locale and verify that the translated survey experience loads for the selected language.
Refer to the developer documentation for platform-specific implementation details.
Steps to determine the App ID:
Log in to the Sprinklr platform.
From Sprinklr Insights, open the Customer Feedback Management (CFM) persona app.
Open an existing Survey Project or create a new one.
Open the survey and navigate to the Distributions tab.
Locate the required In-App distribution, or create a new one as required.
Click the three-dot menu next to the distribution.
Select Copy Live Chat ID.
The copied value is your App ID.
Environment:
The environment refers to the live production environment where your Sprinklr instance is hosted (for example:
Once you have collected the required information, navigate to the Sprinklr Developer Portal to review the SDK setup and installation details. Follow this link for more details.