Skip to content

voiceittech/voiceit3-react-native-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

130 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Dependabot Version License: MIT Platform VoiceIt API

A fully comprehensive React Native SDK that gives you access to VoiceIt's API 3.0 featuring Voice + Face Verification and Identification with built-in native biometric capture UI.

UI Screenshots

The SDK includes a built-in example app in example/ with credential input, language selection, and all enrollment/verification features.

The native biometric capture UI is provided by the underlying iOS SDK and Android SDK:

Getting Started

Sign up at voiceit.io/pricing to get your API Key and Token, then log in to the Dashboard to manage your account.

API Key and Token

Requirements

iOS

  • Minimum Deployment Target: iOS 15.1
  • Camera and Microphone permissions in Info.plist:
<key>NSCameraUsageDescription</key>
<string>This app requires access to your camera for biometric services</string>
<key>NSMicrophoneUsageDescription</key>
<string>This app requires access to your microphone for biometric services</string>

Android

  • Minimum SDK version 24 in build.gradle:
minSdkVersion: 24

Voiceprint Phrases

Review your Voiceprint Phrases at: https://dashboard.voiceit.io/phraseManagement

Installation

This package is hosted on GitHub Packages. Add the registry to your .npmrc:

@voiceittech:registry=https://npm.pkg.github.com

Then install:

npm install @voiceittech/voiceit3-react-native
cd ios && pod install

API Calls

import VoiceItAPI, { VoiceItNative } from '@voiceittech/voiceit3-react-native';

Initialization

Initialize the native module before using encapsulated methods:

VoiceItNative.initVoiceIt('API_KEY', 'AUTH_TOKEN', (res) => {
  console.log(res);
});

Encapsulated Methods

These methods launch built-in native UI for biometric capture (camera/microphone).

Encapsulated Voice Enrollment

VoiceItNative.encapsulatedVoiceEnrollment('usr_...', 'en-US', 'Never forget tomorrow is a new day',
  (res) => console.log('Success:', res),
  (err) => console.log('Failed:', err)
);

Encapsulated Face Enrollment

VoiceItNative.encapsulatedFaceEnrollment('usr_...', 'en-US',
  (res) => console.log('Success:', res),
  (err) => console.log('Failed:', err)
);

Encapsulated Video Enrollment

VoiceItNative.encapsulatedVideoEnrollment('usr_...', 'en-US', 'Never forget tomorrow is a new day',
  (res) => console.log('Success:', res),
  (err) => console.log('Failed:', err)
);

Encapsulated Voice Verification

VoiceItNative.encapsulatedVoiceVerification('usr_...', 'en-US', 'Never forget tomorrow is a new day',
  (res) => console.log('Success:', res),
  (err) => console.log('Failed:', err)
);

Encapsulated Face Verification

VoiceItNative.encapsulatedFaceVerification('usr_...', 'en-US',
  (res) => console.log('Success:', res),
  (err) => console.log('Failed:', err)
);

Encapsulated Video Verification

VoiceItNative.encapsulatedVideoVerification('usr_...', 'en-US', 'Never forget tomorrow is a new day',
  (res) => console.log('Success:', res),
  (err) => console.log('Failed:', err)
);

JS API Client

Use VoiceItAPI for all CRUD operations via direct HTTP calls:

const api = new VoiceItAPI('API_KEY', 'AUTH_TOKEN');

// Users
const users = await api.getAllUsers();
const newUser = await api.createUser();
const exists = await api.checkUserExists('usr_...');
await api.deleteUser('usr_...');
const groups = await api.getGroupsForUser('usr_...');

// Groups
const allGroups = await api.getAllGroups();
const group = await api.getGroup('grp_...');
const newGroup = await api.createGroup('My Group');
await api.deleteGroup('grp_...');
await api.addUserToGroup('grp_...', 'usr_...');
await api.removeUserFromGroup('grp_...', 'usr_...');

// Enrollments
const voiceEnrollments = await api.getAllVoiceEnrollments('usr_...');
const faceEnrollments = await api.getAllFaceEnrollments('usr_...');
const videoEnrollments = await api.getAllVideoEnrollments('usr_...');
await api.deleteAllEnrollments('usr_...');

// Verification
await api.voiceVerification('usr_...', 'en-US', 'my phrase', audioFile);
await api.faceVerification('usr_...', { photo: photoFile });
await api.videoVerification('usr_...', 'en-US', 'my phrase', videoFile);

// Identification
await api.voiceIdentification('grp_...', 'en-US', 'my phrase', audioFile);
await api.faceIdentification('grp_...', { photo: photoFile });
await api.videoIdentification('grp_...', 'en-US', 'my phrase', videoFile);

// Sub-Accounts
const managed = await api.createManagedSubAccount({ firstName: 'John', lastName: 'Doe', email: 'john@example.com', password: 'pass', contentLanguage: 'en-US' });
const unmanaged = await api.createUnmanagedSubAccount({ firstName: 'Jane', lastName: 'Doe', email: 'jane@example.com', password: 'pass', contentLanguage: 'en-US' });
await api.regenerateSubAccountAPIToken('key_...');
await api.deleteSubAccount('key_...');

// Phrases
const phrases = await api.getPhrases('en-US');

Theme Color

To set a custom theme color for the native biometric UI:

VoiceItNative.initVoiceItWithTheme('API_KEY', 'AUTH_TOKEN', '#FBC132', (res) => {
  console.log(res);
});

License

voiceit3-react-native-sdk is available under the MIT license. See the LICENSE file for more info.

About

VoiceIt API 3.0 React Native SDK

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors