react-native-tediwave-biometric-verifier 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +85 -0
  3. package/TediwaveBiometricVerifier.podspec +20 -0
  4. package/android/build.gradle +67 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/tediwavebiometricverifier/TediwaveBiometricVerifierModule.kt +15 -0
  7. package/android/src/main/java/com/tediwavebiometricverifier/TediwaveBiometricVerifierPackage.kt +31 -0
  8. package/ios/TediwaveBiometricVerifier.h +5 -0
  9. package/ios/TediwaveBiometricVerifier.mm +21 -0
  10. package/lib/module/BiometricCamera.js +30 -0
  11. package/lib/module/BiometricCamera.js.map +1 -0
  12. package/lib/module/index.js +6 -0
  13. package/lib/module/index.js.map +1 -0
  14. package/lib/module/logger.js +38 -0
  15. package/lib/module/logger.js.map +1 -0
  16. package/lib/module/package.json +1 -0
  17. package/lib/module/useBiometricEngine.js +458 -0
  18. package/lib/module/useBiometricEngine.js.map +1 -0
  19. package/lib/typescript/package.json +1 -0
  20. package/lib/typescript/src/BiometricCamera.d.ts +14 -0
  21. package/lib/typescript/src/BiometricCamera.d.ts.map +1 -0
  22. package/lib/typescript/src/index.d.ts +5 -0
  23. package/lib/typescript/src/index.d.ts.map +1 -0
  24. package/lib/typescript/src/logger.d.ts +10 -0
  25. package/lib/typescript/src/logger.d.ts.map +1 -0
  26. package/lib/typescript/src/useBiometricEngine.d.ts +99 -0
  27. package/lib/typescript/src/useBiometricEngine.d.ts.map +1 -0
  28. package/package.json +159 -0
  29. package/src/BiometricCamera.tsx +39 -0
  30. package/src/index.tsx +6 -0
  31. package/src/logger.ts +46 -0
  32. package/src/useBiometricEngine.ts +626 -0
package/package.json ADDED
@@ -0,0 +1,159 @@
1
+ {
2
+ "name": "react-native-tediwave-biometric-verifier",
3
+ "version": "0.1.3",
4
+ "description": "Tediwave proprietary on-device biometric video infrastructure library",
5
+ "main": "./lib/module/index.js",
6
+ "types": "./lib/typescript/src/index.d.ts",
7
+ "exports": {
8
+ ".": {
9
+ "source": "./src/index.tsx",
10
+ "types": "./lib/typescript/src/index.d.ts",
11
+ "default": "./lib/module/index.js"
12
+ },
13
+ "./package.json": "./package.json"
14
+ },
15
+ "files": [
16
+ "src",
17
+ "lib",
18
+ "android",
19
+ "ios",
20
+ "cpp",
21
+ "*.podspec",
22
+ "react-native.config.js",
23
+ "!ios/build",
24
+ "!android/build",
25
+ "!android/gradle",
26
+ "!android/gradlew",
27
+ "!android/gradlew.bat",
28
+ "!android/local.properties",
29
+ "!**/__tests__",
30
+ "!**/__fixtures__",
31
+ "!**/__mocks__",
32
+ "!**/.*"
33
+ ],
34
+ "scripts": {
35
+ "example": "yarn workspace react-native-tediwave-biometric-verifier-example",
36
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
37
+ "prepare": "bob build",
38
+ "release": "yarn prepare && npm publish --access public",
39
+ "typecheck": "tsc",
40
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
41
+ "test": "jest"
42
+ },
43
+ "keywords": [
44
+ "react-native",
45
+ "ios",
46
+ "android",
47
+ "biometrics",
48
+ "opencv"
49
+ ],
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/Tediwave/tediwave-biometric-verifier.git"
53
+ },
54
+ "author": "Tediwave <hello@tediwave.com> (https://tediwave.com)",
55
+ "license": "MIT",
56
+ "bugs": {
57
+ "url": "https://github.com/Tediwave/tediwave-biometric-verifier/issues"
58
+ },
59
+ "homepage": "https://github.com/Tediwave/tediwave-biometric-verifier#readme",
60
+ "devDependencies": {
61
+ "@commitlint/config-conventional": "^20.5.0",
62
+ "@eslint/compat": "^2.0.3",
63
+ "@eslint/eslintrc": "^3.3.5",
64
+ "@eslint/js": "^10.0.1",
65
+ "@jest/globals": "^30.0.0",
66
+ "@react-native/babel-preset": "0.85.0",
67
+ "@react-native/eslint-config": "0.85.0",
68
+ "@react-native/jest-preset": "0.85.0",
69
+ "@types/react": "^19.2.0",
70
+ "@types/react-native": "^0.73.0",
71
+ "commitlint": "^20.5.0",
72
+ "del-cli": "^7.0.0",
73
+ "eslint": "^9.39.4",
74
+ "eslint-config-prettier": "^10.1.8",
75
+ "eslint-plugin-ft-flow": "^3.0.11",
76
+ "eslint-plugin-prettier": "^5.5.5",
77
+ "jest": "^30.3.0",
78
+ "lefthook": "^2.1.4",
79
+ "prettier": "^3.8.1",
80
+ "react": "19.2.3",
81
+ "react-native": "0.85.0",
82
+ "react-native-builder-bob": "^0.41.0",
83
+ "react-native-fast-opencv": "^0.4.8",
84
+ "react-native-reanimated": "4.3.1",
85
+ "react-native-tts": "^4.1.1",
86
+ "react-native-vision-camera": "^5.0.10",
87
+ "turbo": "^2.8.21",
88
+ "typescript": "^6.0.2",
89
+ "vision-camera-resize-plugin": "^3.2.0"
90
+ },
91
+ "peerDependencies": {
92
+ "react": "*",
93
+ "react-native": "*",
94
+ "react-native-fast-opencv": "*",
95
+ "react-native-vision-camera": ">= 4.0.0"
96
+ },
97
+ "workspaces": [
98
+ "example"
99
+ ],
100
+ "packageManager": "yarn@4.11.0",
101
+ "react-native-builder-bob": {
102
+ "source": "src",
103
+ "output": "lib",
104
+ "targets": [
105
+ [
106
+ "module",
107
+ {
108
+ "esm": true
109
+ }
110
+ ],
111
+ [
112
+ "typescript",
113
+ {
114
+ "project": "tsconfig.build.json"
115
+ }
116
+ ]
117
+ ]
118
+ },
119
+ "codegenConfig": {
120
+ "name": "TediwaveBiometricVerifierSpec",
121
+ "type": "modules",
122
+ "jsSrcsDir": "src",
123
+ "android": {
124
+ "javaPackageName": "com.tediwavebiometricverifier"
125
+ }
126
+ },
127
+ "prettier": {
128
+ "quoteProps": "consistent",
129
+ "singleQuote": true,
130
+ "tabWidth": 2,
131
+ "trailingComma": "es5",
132
+ "useTabs": false
133
+ },
134
+ "jest": {
135
+ "preset": "@react-native/jest-preset",
136
+ "modulePathIgnorePatterns": [
137
+ "<rootDir>/example/node_modules",
138
+ "<rootDir>/lib/"
139
+ ]
140
+ },
141
+ "commitlint": {
142
+ "extends": [
143
+ "@commitlint/config-conventional"
144
+ ]
145
+ },
146
+ "create-react-native-library": {
147
+ "type": "turbo-module",
148
+ "languages": "kotlin-objc",
149
+ "tools": [
150
+ "eslint",
151
+ "jest",
152
+ "lefthook"
153
+ ],
154
+ "version": "0.62.0"
155
+ },
156
+ "dependencies": {
157
+ "react-native-worklets-core": "^1.6.3"
158
+ }
159
+ }
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { View } from 'react-native';
3
+ import type { StyleProp, ViewStyle } from 'react-native';
4
+ import { Camera } from 'react-native-vision-camera';
5
+
6
+ interface BiometricCameraProps {
7
+ style?: StyleProp<ViewStyle>;
8
+ isActive?: boolean;
9
+ device?: any;
10
+ frameProcessor?: any;
11
+ frameProcessorFps?: number;
12
+ children?: React.ReactNode;
13
+ [key: string]: any;
14
+ }
15
+
16
+ export function BiometricCamera({
17
+ style,
18
+ isActive = true,
19
+ frameProcessor,
20
+ frameProcessorFps = 1,
21
+ children,
22
+ ...cameraProps
23
+ }: BiometricCameraProps) {
24
+ const CameraAny: any = Camera;
25
+ return (
26
+ <View style={style}>
27
+ <CameraAny
28
+ {...cameraProps}
29
+ isActive={isActive}
30
+ frameProcessor={frameProcessor}
31
+ frameProcessorFps={frameProcessorFps}
32
+ style={{ flex: 1 }}
33
+ />
34
+ {children}
35
+ </View>
36
+ );
37
+ }
38
+
39
+ export default BiometricCamera;
package/src/index.tsx ADDED
@@ -0,0 +1,6 @@
1
+ import { useBiometricEngine } from './useBiometricEngine.ts';
2
+ import { BiometricCamera } from './BiometricCamera.tsx';
3
+
4
+ export { useBiometricEngine, BiometricCamera };
5
+
6
+ export type { ChallengeType } from './useBiometricEngine.ts';
package/src/logger.ts ADDED
@@ -0,0 +1,46 @@
1
+ type LogLevel = 'debug' | 'info' | 'warn' | 'error';
2
+
3
+ const LEVEL_ORDER: Record<LogLevel, number> = {
4
+ debug: 0,
5
+ info: 1,
6
+ warn: 2,
7
+ error: 3,
8
+ };
9
+
10
+ // Use globalThis to avoid depending on Node's `process` type in the build
11
+ let CURRENT_LEVEL: LogLevel =
12
+ ((globalThis as any).process?.env?.LOG_LEVEL as LogLevel) || 'debug';
13
+
14
+ function shouldLog(level: LogLevel) {
15
+ return (
16
+ LEVEL_ORDER[level] >= LEVEL_ORDER[CURRENT_LEVEL] ||
17
+ CURRENT_LEVEL === 'debug'
18
+ );
19
+ }
20
+
21
+ function formatMessage(level: LogLevel, tag: string, message: unknown) {
22
+ const ts = new Date().toISOString();
23
+ const payload =
24
+ typeof message === 'string' ? message : JSON.stringify(message);
25
+ return `[${ts}] [${level.toUpperCase()}] [${tag}] ${payload}`;
26
+ }
27
+
28
+ export const logger = {
29
+ setLevel(l: LogLevel) {
30
+ CURRENT_LEVEL = l;
31
+ },
32
+ debug(tag: string, msg: unknown) {
33
+ if (shouldLog('debug')) console.debug(formatMessage('debug', tag, msg));
34
+ },
35
+ info(tag: string, msg: unknown) {
36
+ if (shouldLog('info')) console.info(formatMessage('info', tag, msg));
37
+ },
38
+ warn(tag: string, msg: unknown) {
39
+ if (shouldLog('warn')) console.warn(formatMessage('warn', tag, msg));
40
+ },
41
+ error(tag: string, msg: unknown) {
42
+ if (shouldLog('error')) console.error(formatMessage('error', tag, msg));
43
+ },
44
+ };
45
+
46
+ export default logger;