
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
facetec-react-native-adaptor
Advanced tools
React Native bridge for FaceTec SDK - Biometric facial verification
React Native bridge for FaceTec SDK - Biometric facial verification for iOS and Android.
npm install facetec-react-native-adaptor
# or
yarn add facetec-react-native-adaptor
Add FaceTec.xcframework to your iOS project:
FaceTec.xcframework into your Xcode projectAdd required permissions to Info.plist:
<key>NSCameraUsageDescription</key>
<string>Camera access is required for facial verification</string>
cd ios && pod install
The FaceTec SDK AAR is already included in the package. Just add required permissions to AndroidManifest.xml:
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
import { init, liveness, photoMatch, authenticate, parseResponse, FaceTecConfig } from 'facetec-react-native-adaptor';
// Configure with your FaceTec credentials
const config: FaceTecConfig = {
deviceKeyIdentifier: 'YOUR_DEVICE_KEY_IDENTIFIER',
appKey: 'YOUR_APP_KEY',
baseURL: 'https://your-facetec-server.com',
publicFaceScanEncryptionKey: '-----BEGIN PUBLIC KEY-----\n...\n-----END PUBLIC KEY-----',
productionMode: false, // Set to true for production
language: 'es', // 'es' for Spanish, 'en' for English
primaryColor: '#417FB2', // Color for text and UI elements
logoURL: 'https://example.com/your-logo.png', // Optional logo URL
};
// Initialize the SDK (call once at app startup)
async function initializeFaceTec() {
try {
const success = await init(config);
console.log('FaceTec initialized:', success);
} catch (error) {
console.error('Failed to initialize FaceTec:', error);
}
}
// Perform liveness check
async function checkLiveness() {
try {
const result = await liveness();
const response = parseResponse(result);
if (response.wasProcessed) {
console.log('Liveness verified!');
}
} catch (error) {
console.error('Liveness check failed:', error);
}
}
// Enroll user with Photo ID
async function enrollUser() {
try {
const result = await photoMatch();
const response = parseResponse(result);
if (response.wasProcessed) {
// Save externalDatabaseRefID for future authentication
const userId = response.externalDatabaseRefID;
console.log('User enrolled with ID:', userId);
}
} catch (error) {
console.error('Enrollment failed:', error);
}
}
// Authenticate existing user
async function authenticateUser(userId: string) {
try {
const result = await authenticate(userId);
const response = parseResponse(result);
if (response.wasProcessed) {
console.log('User authenticated successfully!');
}
} catch (error) {
console.error('Authentication failed:', error);
}
}
import FaceTec, { FaceTecConfig } from 'facetec-react-native-adaptor';
const config: FaceTecConfig = {
deviceKeyIdentifier: 'YOUR_DEVICE_KEY',
appKey: 'YOUR_APP_KEY',
baseURL: 'https://your-server.com',
publicFaceScanEncryptionKey: '...',
productionMode: false,
};
// Initialize
await FaceTec.init(config);
// Check liveness
const livenessResult = await FaceTec.liveness();
// Enroll with Photo ID
const enrollResult = await FaceTec.photoMatch();
// Authenticate
const authResult = await FaceTec.authenticate('user-reference-id');
init(config: FaceTecConfig): Promise<boolean>Initialize the FaceTec SDK with your configuration. Must be called before any other methods.
Parameters:
config.deviceKeyIdentifier: Your FaceTec Device Key Identifierconfig.appKey: Your FaceTec App Key (Production Key)config.baseURL: URL of your FaceTec Server SDK backendconfig.publicFaceScanEncryptionKey: Your FaceTec Public Encryption Keyconfig.productionMode: (optional) Set to true for production mode, defaults to falseconfig.language: (optional) UI language - 'es' for Spanish, 'en' for English, defaults to 'en'config.primaryColor: (optional) Hex color for text and UI elements, defaults to '#417FB2'config.logoURL: (optional) URL to your logo image to display in the FaceTec UIReturns: true if initialization was successful.
liveness(): Promise<string>Perform a liveness check to verify a real person is present.
Returns: JSON string with the verification result.
photoMatch(): Promise<string>Perform enrollment with Photo ID document scanning and face matching.
Returns: JSON string with enrollment result including externalDatabaseRefID.
authenticate(externalReferenceId: string): Promise<string>Authenticate a user against a previous enrollment.
Parameters:
externalReferenceId: The ID returned from a previous photoMatch() call.Returns: JSON string with authentication result.
parseResponse(responseString: string): FaceTecResponseHelper function to parse FaceTec response strings.
Returns: Parsed FaceTecResponse object.
interface FaceTecConfig {
deviceKeyIdentifier: string;
appKey: string;
baseURL: string;
publicFaceScanEncryptionKey: string;
productionMode?: boolean;
language?: 'es' | 'en';
primaryColor?: string;
logoURL?: string;
}
interface FaceTecResponse {
wasProcessed: boolean;
success?: boolean;
scanResultBlob?: string;
externalDatabaseRefID?: string;
[key: string]: any;
}
This SDK requires a FaceTec Server SDK backend to process the biometric data. Your server must implement the following endpoints:
GET /session-token - Returns a session tokenPOST /liveness-3d - Process liveness checkPOST /enrollment-3d - Process enrollmentPOST /match-3d-2d-idscan - Process Photo ID matchPOST /match-3d-3d - Process authenticationRefer to the FaceTec Server SDK documentation for implementation details.
FaceTec module not found: Ensure FaceTec.xcframework is properly added to your Xcode project.
Bridging header issues: Verify the bridging header path in your project's Build Settings.
SDK not found: The AAR is included in the package. Make sure your build.gradle is configured correctly.
Multidex issues: Enable multidex in your android/app/build.gradle:
android {
defaultConfig {
multiDexEnabled true
}
}
Initialization fails: Verify your credentials are correct and match your FaceTec account.
Network errors: Ensure your baseURL is correct and the server is accessible.
"SDK not initialized" errors: Make sure to call init() before using other methods.
MIT
See the contributing guide to learn how to contribute to the repository.
For FaceTec SDK support, visit FaceTec Support.
Made with create-react-native-library
FAQs
React Native bridge for FaceTec SDK - Biometric facial verification
We found that facetec-react-native-adaptor demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.