ReactNativeFaceTec
React Native module that integrates FaceTec ZoOm face verification API
Install / Use
/learn @GoodDollar/ReactNativeFaceTecREADME
ReactNative FaceTec SDK Integration
Only works with facetec V9 SDKS
Getting started
$ npm install @gooddollar/react-native-facetec --save
Mostly automatic installation
$ react-native link @gooddollar/react-native-facetec
Copy V9 SDKs
- Download SDKs from facetec website
- Copy SDKs to
node_modules/@gooddollar/react-native-facetec - Change working directory
cd node_modules/@gooddollar/react-native-facetec - Run update script
./updateSDKs.sh
Usage
import FaceTec from '@gooddollar/react-native-facetec';
import Config from 'react-native-config'
const {
REACT_APP_ZOOM_ENCRYPTION_KEY,
REACT_APP_ZOOM_LICENSE_KEY,
REACT_APP_ZOOM_LICENSE_TEXT,
REACT_APP_SERVER_URL = 'http://localhost:3003',
REACT_APP_SERVER_TOKEN,
REACT_APP_ENROLLMENT_IDENTIFIER,
} = Config
// ... some component body
useEffect(() => {
FaceTec.sdk.initialize(
REACT_APP_SERVER_URL,
REACT_APP_SERVER_TOKEN,
REACT_APP_ZOOM_LICENSE_KEY,
REACT_APP_ZOOM_ENCRYPTION_KEY,
REACT_APP_ZOOM_LICENSE_TEXT
)
.then(() => { /* on initialized handler here */ })
.catch(e => { /* initialized failed handler here */ })
}, [])
const onMyButtonClicked = useCallback(() => {
FaceTec.sdk.enroll(REACT_APP_ENROLLMENT_IDENTIFIER, 3, 60000)
.then(() => { /* verification successfull handler here */ })
.catch(() => { /* verification failed handler here */ })
}, [])
Handling exceptions
import FaceTec, { FaceTecSDKStatus, FaceTecSessionStatus } from '@gooddollar/react-native-facetec';
// ...
FaceTec.sdk.initialize(...).then(...)
.catch(exception => {
// see platform API docs for complete status codes list
if (exception.code === FaceTecSDKStatus.DeviceNotSupported) {
// suggest user to use another device
}
})
FaceTec.sdk.enroll(...).then(...)
.catch(exception => {
// see platform API docs for complete status codes list
if (exception.code === FaceTecSDKStatus.CameraPermissionDenied) {
// show some help how to allow camera access on his platform/device
}
})
Listening events
import FaceTec, { FaceTecUxEvent } from '@gooddollar/react-native-facetec';
// ...
// subscribe
const subscriptions = [
FaceTec.sdk.addListener(FaceTecUxEvent.UI_READY, () => { /* facetec was initialized and its UI was shown */ })),
FaceTec.sdk.addListener(FaceTecUxEvent.CAPTURE_DONE, () => { /* user has finished capturing has face and request being sent to the FaceTec Custom Server */ }),
FaceTec.sdk.addListener(FaceTecUxEvent.FV_RETRY, () => { /* FaceTec is asking user to retry face capture process */ }),
]
// unsubscribe
for (unsubscribe of subscriptions) {
unsubscribe()
}
Update SDKs
Android
- Goto https://dev.facetec.com/downloads
- Download Android SDK
- Remove
./android/libs/*.aar - Copy
./facetec-sdk-9.X.YY.aarfrom android sdk archive to./android/libs
Web
- Goto https://dev.facetec.com/downloads
- Download Browser SDK
- Remove
./web/sdk/FaceTecSDK.web.js./web/sdk/images/*.png./web/sdk/resources/*.*(keep folders) - Copy
./core-sdk/FaceTecSDK.js/FaceTecSDK.jsfrom browser sdk archive to./web/sdk/FaceTecSDK.web.js(.websuffix is mandatory) - Copy ``./core-sdk/FaceTecSDK.js/resources/.
from browser sdk archive to./web/sdk/resources/` - Copy ``./core-sdk/FaceTec_images/*.png
from browser sdk archive to./web/sdk/images/`
Related Skills
node-connect
348.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
