Two packages, a handful of native peers, and one Expo plugin. Prebuild once and you're ready.
| Prop | Type | Default | Description |
|---|---|---|---|
react-nativeRequired | >= 0.78 | No default | Minimum supported React Native version. |
Expo SDKRequired | >= 50 | No default | Needed for the audio module's Expo plugin. |
Development buildOptional | required | No default | The SDK includes native code, so it runs in a custom dev build — not Expo Go. |
This SDK includes a native module for echo-cancelled mic streaming and PCM playback. It will not run in Expo Go — you must use a development build (npx expo prebuild + a custom dev client or a bare workflow).
@avatarfactory/react-native and @avatarfactory/expo-audio are private
packages. Add a .npmrc at your project root with the token issued with your
plan:
Keep the token in your environment rather than in the file, so the .npmrc stays
safe to commit. EAS builds need it too — set it as a secret. Full setup:
Get access.
Install the latest — don't pin a version. The SDK is pre-1.0 and these docs
track the current release, so a pinned version drifts out of sync with what is
documented here. Run npm ls @avatarfactory/react-native to see what you are on.
| Prop | Type | Default | Description |
|---|---|---|---|
@rive-app/react-nativeRequired | >= 0.4.0 | No default | Rive native runtime — renders the avatar character and drives lip-sync. |
@react-native-async-storage/async-storageRequired | >= 1.0.0 | No default | Backs the avatar asset cache so .riv files load instantly on repeat opens. |
expo-cameraRequired | >= 16.0.0 | No default | Camera access for the optional perception feature. A declared peer dependency, so install it even if you never enable the camera. |
expo-image-manipulatorRequired | >= 13.0.0 | No default | Downscales and encodes camera frames before they are sent. |
reactRequired | >= 18 | No default | Core React library. |
react-nativeRequired | >= 0.78 | No default | React Native runtime. |
expo-camera and expo-image-manipulator are peer dependencies whether or not
you use camera perception. Install them to keep
the dependency tree resolvable; the camera itself stays off until you opt in
with perception: { camera: true }.
@avatarfactory/expo-audio ships a config plugin that wires up the native audio module and declares microphone permissions for you. Add it in your app.json / app.config.js:
The plugin automatically adds:
NSMicrophoneUsageDescription to Info.plistRECORD_AUDIO and MODIFY_AUDIO_SETTINGS to AndroidManifest.xmlThen run prebuild to apply the native changes:
Rebuild your dev client (npx expo run:ios / npx expo run:android, or an EAS build) after adding the plugin. A JS-only reload won't pick up the new native code.
No stylesheet import is needed — React Native styles everything inline.
Always give <Avatar> an explicit size via style (or wrap it in a sized parent). Its root view is flex: 1, so inside an unsized parent it can collapse to zero height and appear invisible. See Styling.
On React Native, production uses getSessionToken — your backend mints a short-lived token. The apiKey method is allowed for local development but accepts test keys only (af_test_*); live keys must use getSessionToken. See AvatarProvider → Authentication for the backend route handler.