ABTasty QA Assistant for React Native

This guide covers the integration of the ABTasty QA Assistant into React Native applications. For usage instructions, see the QA Usage Guide

Overview

What is ABTasty QA Assistant?

The ABTasty QA Assistant is a visual testing tool for React Native applications that integrates with ABTasty Feature Experimentation. It provides a floating UI overlay that allows developers and QA engineers to test campaign variations and feature flags without backend changes or app redeployment.

Key features

  • Force variations: Switches to a specific variation within a campaign

  • Force allocation: Makes a rejected campaign available for testing

  • Hide campaign: Hide accepted campaigns to test exclusion scenarios

  • Real-time event monitoring: Track all SDK events for integration verification

  • Context inspection: View visitor data and targeting rules

  • Search & filter: Quickly find specific campaigns and events

circle-info

Forced allocations, variations, and hidden campaigns are temporary and reset when you disable QA mode or restart the app. Everything returns to natural allocation automatically.

Prerequisites

Requirement
Minimum Version

React Native

>= 0.70.0

React

>= 18.0.0

Flagship React Native SDK

>= 5.0.2


Installation

1

Install Flagship SDK (if not already installed)

2

Install the Package

Dependencies

The QA Assistant has the following dependencies:

Peer Dependencies (must be installed separately):

  • @flagship.io/react-native-sdk >= 5.0.2

  • react >= 18.0.0

  • react-native >= 0.70.0

Integration

Quick start

Add the QA Assistant to your app in two steps:

1

Enable QA Mode in FlagshipProvider

circle-exclamation

2

Development-Only usage

Ensure the QA Assistant only appears in development builds:

Configuration options

Customize the QA Assistant appearance and behavior:

Available positions:

  • "top-right" - Top right corner

  • "top-left" - Top left corner

  • "bottom-right" - Bottom right corner (default)

  • "bottom-left" - Bottom left corner

Complete example

Best practices

DO:

  • Always use isQAModeEnabled={true} in FlagshipProvider

  • Place QAAssistant inside FlagshipProvider

  • Use conditional rendering (__DEV__) to exclude from production

  • Use SDK hooks to ensure flag changes are reactive

DON'T:

  • Never include QA Assistant in production builds

  • Don't place QA Assistant outside FlagshipProvider

  • Don't hardcode flag values - always use SDK hooks

triangle-exclamation

Troubleshooting & FAQ

Common issues

QA Assistant not showing

Checklist:

  1. Verify isQAModeEnabled is set to true

  2. Ensure QAAssistant is inside FlagshipProvider

  3. Check conditional rendering

  4. Clear cache and reinstall

Console warnings

Warning: "Not able to access Flagship SDK instance"

Cause 1: QAAssistant is not a direct child of FlagshipProvider.

Solution: Move QAAssistant inside FlagshipProvider.

Cause 2: Flagship React Native SDK version is incompatible (< 5.0.2).

Solution: Update to SDK version >= 5.0.2:

Warning: "QA mode not enabled"

Solution: Add isQAModeEnabled={true} to FlagshipProvider.

Warning: "No valid envId configured"

Solution: Verify envId prop is set correctly in FlagshipProvider.

Campaigns not appearing

Possible Causes:

  1. No campaigns configured - Check ABTasty platform

  2. Network issues - Verify bucketing.json loads correctly

  3. Wrong environment - Ensure using correct envId

  4. SDK initialization - Wait a few seconds after app launch

Forced Variations not applying

Solutions:

  1. Use SDK hooks - Ensure you're using useFsFlag():

  2. Verify correct variation - Check that the forced variation contains the expected flag modifications

  3. Reset and retry - Clear forced variations and try again

Floating button overlapping UI

Solutions:

  1. Changeposition:

Frequently asked questions

Q: Do forced allocations persist after app restart? A: NO! All forced allocations, hidden campaigns, and variations are temporary and reset automatically when:

  • You disable QA mode (set isQAModeEnabled={false})

  • You restart the app

This is by design to ensure a clean state and prevent accidental forced states in production.

Q: Can I force multiple campaigns at once? A: Yes, each forced variation, allocation, and hidden campaign is independent.

Q: What's the difference between forcing a variation, allocation, and hiding a campaign?

Action
When to Use
Effect

Force Variation

Campaign is accepted or forced

Switch between variations

Force Allocation

Campaign is rejected

Enable variation forcing (badge changes to "Forced", stays in Rejected section)

Hide Campaign

Campaign is accepted

Hide accepted campaign (test exclusion)

Q: Can I use QA Assistant in production? A: NO! Always use conditional rendering ({__DEV__ && <QAAssistant />}) to exclude it from production.

Q: Does QA Assistant work offline? A: Initial load requires network to fetch campaigns. After that, it works offline with cached data.

Q: Can I force variations programmatically? A: QA Assistant is for manual testing. For automated tests, use Flagship SDK methods directly with controlled context values.

Additional resources

Last updated

Was this helpful?