Notice: This documentation is currently a work in progress for the upcoming v6 release and some content may be missing or incomplete. If you're not interested in testing out the alpha version of v6 then please click here to be taken to the v5 documentation.

edit  Edit page
message  Send Feedback

ML Kit Quick Start


Install this module with Yarn:

yarn add @react-native-firebase/ml-natural-language

Integrating manually and not via React Native auto-linking? Check the setup instructions for Android & iOS.

Module usage

Import the ML Kit package into your project:

import mlNaturalLanguage from '@react-native-firebase/ml-natural-language';

The package also provides access to the firebase instance:

import { firebase } from '@react-native-firebase/ml-natural-language';

Configuring Models

To be able to use the APIs you'll need to enable the models for the APIs you wish to use.

React Native Firebase allows you to configure these in via a firebase.json file in your project root.

Add any of the keys indicated below to your JSON file and set them to true to enable them. All models and APIs are disabled (false) by default.

'react-native': {
// Language Identification
ml_natural_language_language_id_model: false,
// Smart Replies
ml_natural_language_smart_reply_model: false,

If you are manually linking on iOS (e.g. not using CocoaPods) then it's up to you to manage these models and dependencies yourself - firebase.json support is only for Android and iOS (via Pods).

To learn more, view the App documentation.