Skip to main content

Installation

Prerequisites

Before installing react-native-nitro-inspire-face, you need to have react-native-nitro-modules set up in your project.

Installing the library

Install react-native-nitro-inspire-face through your preferred package manager:

npx expo install react-native-nitro-modules react-native-nitro-inspire-face

Model Package Setup

This library requires model files from the InspireFace SDK to function. The models are available in different packages optimized for various use cases:

  • Pikachu (Default) - Lightweight edge-side models (~15.8MB)
  • Megatron - Mobile and server models (~60.2MB)

You can choose between two approaches for loading models:

Load models at runtime by downloading them from a remote URL (e.g., CDN, GitHub Releases, or Cloudflare R2). This approach significantly reduces your app bundle size and is recommended for most use cases.

Setup:

  1. Host your model package on a CDN or file server
  2. Calculate the SHA-256 checksum of your model file
  3. Use the launchWithRemoteModel() function in your app code (see Basic Usage for examples)

No build-time configuration is needed for this approach.

Option 2: Bundle Models at Build Time

Bundle the model package directly with your app. This increases your app size but ensures the model is always available offline.

Setup: Download your chosen model package from the InspireFace Releases page and follow the configuration steps below.

Project Configuration

info

Skip this section if you're using Runtime Model Loading (Option 1). The configuration below is only needed if you want to bundle models at build time.

Expo Setup

  1. Add the plugin to your Expo config (app.json, app.config.json or app.config.js):
{
"expo": {
"plugins": [
[
"react-native-nitro-inspire-face",
{
"modelName": "Pikachu", // Optional: specify model to bundle (e.g., "Pikachu" or "Megatron")
"modelDir": "assets/models" // Optional: custom directory for model files (defaults to project root)
}
]
]
}
}
note

If you're using runtime model loading, you can omit the modelName property or leave the config empty:

["react-native-nitro-inspire-face"]
  1. Place the model package in your project's root directory (or in the custom directory specified by modelDir).

  2. Run the command to copy the model package into both the iOS and Android platforms.

npx expo prebuild

Next Steps

Now that you have installed react-native-nitro-inspire-face and set up the model package, you can start using the library in your project. Check out the Basic Usage guide to learn how to implement face detection and recognition features.