Nosmai  Effects Nosmai  Moderation Nosmai Try-ons coming soon
Docs menu React Native
Tutorial

React Native quickstart

Mount the Fabric camera preview, initialize Nosmai Effects, start processing, and apply a beauty effect in React Native.

Platform React Native SDK version 1.0.0 Updated Aug 22, 2026 Time 15 min

Prerequisites

1. Request native permission

Android hosts own the runtime camera prompt. The iOS bridge asks when camera authorization is undetermined, but NSCameraUsageDescription must still exist.

2. Mount the native preview

Mount one Fabric preview and record when its native view exists:

<NosmaiCameraView
  style={{ flex: 1 }}
  cameraPosition="front"
  mirror
  onLayout={() => setViewMounted(true)}
  onReady={() => {
    void NosmaiCameraSdk.setSkinSmoothing(0.4);
  }}
  onError={(error) => {
    console.error(error.code, error.message);
  }}
/>

3. Initialize and start processing

Start only after the preview has mounted. Select the key for the current native application:

useEffect(() => {
  if (!viewMounted) return;

  const licenseKey = Platform.select({
    android: ANDROID_LICENSE_KEY,
    ios: IOS_LICENSE_KEY,
    default: '',
  });

  const start = async () => {
    const accepted = await NosmaiCameraSdk.initialize(licenseKey);
    if (!accepted) {
      throw new Error('Nosmai initialization was not accepted');
    }

    await NosmaiCameraSdk.configureCamera({ position: 'front' });
    await NosmaiCameraSdk.startProcessing();
  };

  void start().catch(console.error);

  return () => {
    void NosmaiCameraSdk.cleanup();
  };
}, [viewMounted]);

Replace the documentation constants with application-owned runtime configuration. The view must be mounted before startProcessing() and another camera controller must not own the device.

4. Run the native build

Android:

yarn android

iOS physical device:

yarn ios --device

For Expo SDK 54, use npx expo run:android or npx expo run:ios --device after prebuild. Expo Go is not supported.

Package example app

For a complete runnable implementation, open the React Native package example app. This example matches the documented Expo 54 and React Native 0.81 New Architecture compatibility line. Add the verified Android AAR and your own app-bound platform licence keys before running it on a physical device.

Verify it worked

You should see a full-size camera preview and the status Camera ready with skin smoothing. The skin-smoothing level is 0.4. Navigate away and confirm the operating-system camera indicator turns off after cleanup.

Common errors

ErrorCauseFix
E_NOT_INITIALIZEDA camera or effect method ran before successful initializationAwait initialize before configuration and processing
E_NO_PREVIEWProcessing started before a Fabric preview owned the sessionMount NosmaiCameraView and start only after its layout callback
E_CAMERA_PERMISSIONAndroid runtime camera permission is missingRequest PermissionsAndroid.PERMISSIONS.CAMERA before initialization
E_CAMERA_DEVICECamera2 reported a device error, often because another controller still owns the cameraDispose or stop the other camera session before opening Nosmai
E_PROCESSING_STARTNative preview or pipeline could not startKeep one mounted view, inspect the preceding native error, and retry after cleanup

Next steps

References

Was this page helpful?

Your response helps us prioritize documentation improvements.

Nosmai

An AR and AI company. Founded on the idea that the next decade of software will be visual, and that the tools for it should be within reach of anyone building.

Newsletter

Product updates and release notes. No spam.

© 2026 nosmai, inc · all rights reserved