React Native SDK - One-page setup
Create your app and get the key
- Log in to
testernest.comand create an app. - Copy the
publicKeyfrom your app settings. - Copy the
baseUrlfrom SDK Setup for your environment.
1) Install
npm i @testernest/react-native
# or
yarn add @testernest/react-native
Current version: 0.1.4.
Android-only. Minimum supported versions: Android SDK 21+, Kotlin 1.6+.
2) Permissions
No extra permissions required.
3) Initialize
Initialize once at app startup and mount the connect prompt:
import {init, TesternestConnectPrompt} from '@testernest/react-native';
await init({
publicKey: 'YOUR_PUBLIC_KEY',
baseUrl: 'https://testernest.com',
});
export default function App() {
return (
<>
<MainApp />
<TesternestConnectPrompt
publicKey="YOUR_PUBLIC_KEY"
baseUrl="https://testernest.com"
autoInit={false}
/>
</>
);
}
4) Connect tester (6-digit code)
Testers enter a 6-digit code, and the SDK claims/connects the device:
import {connectTester} from '@testernest/react-native';
await connectTester('123456');
5) Track screens + events (minimal)
Keep screen context synced and optionally emit a screen_view event:
import {NavigationContainer, createNavigationContainerRef} from '@react-navigation/native';
import {setCurrentScreen, track} from '@testernest/react-native';
import {useRef} from 'react';
const navigationRef = createNavigationContainerRef();
function AppNavigation() {
const routeNameRef = useRef<string | undefined>();
return (
<NavigationContainer
ref={navigationRef}
onReady={() => {
const name = navigationRef.getCurrentRoute()?.name;
routeNameRef.current = name;
if (name) {
setCurrentScreen(name);
track('screen_view', {screen: name});
}
}}
onStateChange={() => {
const name = navigationRef.getCurrentRoute()?.name;
if (name && routeNameRef.current !== name) {
routeNameRef.current = name;
setCurrentScreen(name);
track('screen_view', {screen: name});
}
}}
>
{/* your app screens */}
</NavigationContainer>
);
}
6) Verify
Filter Logcat for the following tags:
BOOTSTRAPCLAIMBATCH
Success signals:
BOOTSTRAP: key accepted and SDK initializedCLAIM 200: tester code connectedBATCH 200: events uploaded successfully
Troubleshooting
- Metro not running: Start Metro with
npx react-native start. - White screen: Ensure the prompt is mounted and not hidden by your layout.
- Code invalid: Confirm the app matches the key in the dashboard.
- No logs: Verify initialization runs before the prompt renders.