OkHi on your React Native App

The suite of OkHi react native libraries that will enable you to start collecting and verifying your user's addresses.


To start verifying address you need to integrate two libraries. OkCollect & OkVerify.

  • OkCollect - enables you to launch OkHi from your app and collect accurate addresses from your users.

  • OkVerify - enables you to verify the addresses created from OkCollect.

The OkCollect & OkVerify libraries currently only supports Android devices with iOS support coming soon!


OkHi Client Key and Branch Id

First you need to obtain your OkHi client key and branch ID. You can get these by signing up here.

Use your sandbox keys while you test and develop, and your production mode keys before you publish your app.


Install the OkHi Core module

$ yarn add @okhi/react-native-core

Configure your app


​ Add the following permissions to your AndroidManifest.xml

<manifest ...>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    <uses-permission android:name="android.permission.INTERNET" />


If you're targeting Android versions >= 8 and you're using the OkVerify library you need to make sure your users select on "Allow always" when granting permissions otherwise the verification process won't work.

All OkHi react-native libraries target android devices >= SDK 23. Make sure you're targeting at-least the same by modifying your android/build.gradle file

ext {
  minSdkVersion = 23


​ Make sure to include the following permissions in your info.plist file ​

<string>Add description here</string>


Create a file and configure your OkHiAuth object

$ touch OkHiAuth.js

Place the following code in OkHiAuth.js and change the values as needed

import {OkHiAuth, OkHiContext, OkHiMode} from '@okhi/react-native-core';

const context = new OkHiContext({
  mode: OkHiMode.SANDBOX,
  app: {
    build: 1,
    name: 'My App',
    version: '1.0.0',

export default OkHiAuth.withContext({branchId: "<my_branch_id>", clientKey: "<my_client_key>"}, context);

See OkHi Core API reference here.

Last updated