---
name: ansight-migrate-sdk-1-1-react-native
description: Migrate a React Native app or Expo development build from an older @ansight/react-native pairing-config integration to SDK 1.1 zero-touch developer enrollment. Use when upgrading npm and native dependencies, deleting pairingConfigJson or bundledDeveloperConfigJson environment plumbing, simplifying initializeAndActivate, or adding generic physical-device QR enrollment.
---

# Migrate React Native to Ansight SDK 1.1

Upgrade the JavaScript bridge and matching native packages, remove pairing
payload plumbing, and use native zero-touch enrollment.

## Migration

1. Identify the package manager, app bootstrap, native Android and iOS
   projects, development guard, pairing environment variables, and scanner UI.
2. Upgrade and relink:

```shell
npm install @ansight/react-native@1.3.0-preview.10
npx pod-install
```

3. Remove `pairingConfigJson`, `bundledDeveloperConfigJson`, pairing payload
   environment variables, generated native resources, host addresses, Wi-Fi
   names, certificate settings, and build-time desktop-host probes.
4. Remove startup calls that pass pairing JSON to `connect(...)`. Do not retain
   an old configuration fallback.
5. Initialize once from development bootstrap:

```ts
await Ansight.initializeAndActivate({
  useNativeAllInOneDefaults: __DEV__,
  clientName: "My React Native App",
  toolGuard: __DEV__ ? "readOnly" : "disabled",
  lifecycle: true,
});
```

6. Add a developer-only physical-device action:

```ts
await Ansight.enrollFromQrCode({
  clientName: "My React Native App",
});
```

7. If the app already owns a scanner, pass its scanned text to `connect(...)`
   instead of adding a second scanner.

## Native version alignment

The package expects matching CocoaPods and Maven artifacts at
`1.3.0-preview.10`. Rebuild both native apps after the JavaScript upgrade and
inspect lockfiles if an older native package is still selected.

## Permissions

Android requires no app camera permission for the SDK scanner. On iOS, add
`NSCameraUsageDescription` for scanning and `NSLocalNetworkUsageDescription`
for direct device access. Add no ATS exception or unrelated permissions.

## Verification

Run the package checks used by the repository, reinstall pods, and build both
development targets. With `ansight host run` active:

- verify an emulator and Simulator connect without a payload;
- enroll each physical platform once with the generic
  `ansight pairing issue --qr`; the SDK supplies its real App ID;
- relaunch and verify automatic reconnect; and
- confirm production bundles disable the developer tools.

Confirm each live session with `ansight session list --connected --app-id <app-id> --json`.
