react-native-usesense 1.0.0
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.
- package/LICENSE +18 -0
- package/README.md +529 -0
- package/android/build.gradle +42 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/usesense/reactnative/UseSenseModule.kt +158 -0
- package/android/src/main/java/com/usesense/reactnative/UseSensePackage.kt +17 -0
- package/ios/UseSenseModule.m +25 -0
- package/ios/UseSenseModule.swift +148 -0
- package/lib/commonjs/index.js +179 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/module/index.js +172 -0
- package/lib/module/index.js.map +1 -0
- package/lib/typescript/src/index.d.ts +196 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +93 -0
- package/react-native-usesense.podspec +24 -0
- package/src/index.ts +251 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import { NativeModules, NativeEventEmitter } from 'react-native';
|
|
2
|
+
const {
|
|
3
|
+
UseSenseModule
|
|
4
|
+
} = NativeModules;
|
|
5
|
+
if (!UseSenseModule) {
|
|
6
|
+
throw new Error('react-native-usesense: NativeModule not found. Make sure you have linked the library correctly.\n' + 'iOS: Run `cd ios && pod install`\n' + 'Android: Rebuild the app after installing the package.');
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// ─── Types ───────────────────────────────────────────────────────────
|
|
10
|
+
|
|
11
|
+
/** Environment for the UseSense API. */
|
|
12
|
+
|
|
13
|
+
/** Session type for verification. */
|
|
14
|
+
|
|
15
|
+
/** Challenge policy controlling verification difficulty. */
|
|
16
|
+
|
|
17
|
+
/** Decision returned by the verification engine. */
|
|
18
|
+
|
|
19
|
+
/** Processing stage during server-side analysis. */
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Configuration for initializing the UseSense plugin.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* await UseSense.initialize({
|
|
27
|
+
* apiKey: 'your_api_key',
|
|
28
|
+
* environment: 'sandbox',
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Result returned when a verification session completes.
|
|
35
|
+
*
|
|
36
|
+
* **Important:** This result is for UI feedback only.
|
|
37
|
+
* The definitive verdict arrives at your backend via HMAC-signed webhook.
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Error returned when a verification session fails.
|
|
42
|
+
*/
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Events emitted during the verification session lifecycle.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/** Options for starting a verification session. */
|
|
49
|
+
|
|
50
|
+
/** Status of a verification session. */
|
|
51
|
+
|
|
52
|
+
/** Subscription handle returned by {@link UseSense.addListener}. */
|
|
53
|
+
|
|
54
|
+
// ─── Implementation ──────────────────────────────────────────────────
|
|
55
|
+
|
|
56
|
+
const eventEmitter = new NativeEventEmitter(UseSenseModule);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* UseSense React Native plugin.
|
|
60
|
+
*
|
|
61
|
+
* Provides human presence verification by wrapping the native UseSense
|
|
62
|
+
* iOS and Android SDKs into a single cross-platform API.
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```ts
|
|
66
|
+
* import { UseSense } from 'react-native-usesense';
|
|
67
|
+
*
|
|
68
|
+
* await UseSense.initialize({ apiKey: 'your_key', environment: 'sandbox' });
|
|
69
|
+
* const result = await UseSense.startSession({ sessionType: 'enrollment' });
|
|
70
|
+
* console.log(result.decision);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export class UseSense {
|
|
74
|
+
/**
|
|
75
|
+
* Initialize the UseSense plugin. Must be called once before any other method.
|
|
76
|
+
*
|
|
77
|
+
* @param config - Plugin configuration including API key and environment.
|
|
78
|
+
* @throws {UseSenseError} If the API key is invalid or configuration is malformed.
|
|
79
|
+
*/
|
|
80
|
+
static async initialize(config) {
|
|
81
|
+
if (!config.apiKey) {
|
|
82
|
+
throw {
|
|
83
|
+
code: 'invalid_config',
|
|
84
|
+
message: 'apiKey is required'
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
return UseSenseModule.initialize({
|
|
88
|
+
apiKey: config.apiKey,
|
|
89
|
+
environment: config.environment ?? 'sandbox',
|
|
90
|
+
organizationId: config.organizationId,
|
|
91
|
+
sessionType: config.sessionType ?? 'enrollment',
|
|
92
|
+
identityId: config.identityId,
|
|
93
|
+
challengePolicy: config.challengePolicy ?? 'standard',
|
|
94
|
+
enableAudio: config.enableAudio ?? false,
|
|
95
|
+
timeout: config.timeout ?? 60000,
|
|
96
|
+
metadata: config.metadata
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Start a verification session. Presents a full-screen native camera UI.
|
|
102
|
+
*
|
|
103
|
+
* The returned promise resolves when the session completes and the modal
|
|
104
|
+
* dismisses, or rejects if an error occurs.
|
|
105
|
+
*
|
|
106
|
+
* @param options - Optional overrides for session type and identity ID.
|
|
107
|
+
* @returns The verification result (for UI feedback only).
|
|
108
|
+
* @throws {UseSenseError} On failure or cancellation.
|
|
109
|
+
*/
|
|
110
|
+
static async startSession(options) {
|
|
111
|
+
return UseSenseModule.startSession(options ?? {});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Cancel an in-progress verification session.
|
|
116
|
+
*
|
|
117
|
+
* The camera UI is dismissed and the `startSession` promise rejects
|
|
118
|
+
* with a `session_cancelled` error.
|
|
119
|
+
*/
|
|
120
|
+
static async cancelSession() {
|
|
121
|
+
return UseSenseModule.cancelSession();
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Get the status of a verification session by ID.
|
|
126
|
+
*
|
|
127
|
+
* @param sessionId - The session ID to query.
|
|
128
|
+
* @returns The current status and optional result.
|
|
129
|
+
*/
|
|
130
|
+
static async getSessionStatus(sessionId) {
|
|
131
|
+
return UseSenseModule.getSessionStatus(sessionId);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Subscribe to real-time events during the verification lifecycle.
|
|
136
|
+
*
|
|
137
|
+
* Call this before `startSession()` to receive all events.
|
|
138
|
+
*
|
|
139
|
+
* @param callback - Function invoked for each event.
|
|
140
|
+
* @returns A subscription handle with a `remove()` method.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* const listener = UseSense.addListener((event) => {
|
|
145
|
+
* console.log(event.type);
|
|
146
|
+
* });
|
|
147
|
+
* // Later:
|
|
148
|
+
* listener.remove();
|
|
149
|
+
* ```
|
|
150
|
+
*/
|
|
151
|
+
static addListener(callback) {
|
|
152
|
+
UseSenseModule.subscribeToEvents();
|
|
153
|
+
const subscription = eventEmitter.addListener('UseSenseEvent', callback);
|
|
154
|
+
return {
|
|
155
|
+
remove: () => {
|
|
156
|
+
subscription.remove();
|
|
157
|
+
UseSenseModule.unsubscribeFromEvents();
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Get the native SDK version string.
|
|
164
|
+
*
|
|
165
|
+
* @returns Version string in semver format (e.g. `"1.0.0"`).
|
|
166
|
+
*/
|
|
167
|
+
static getSdkVersion() {
|
|
168
|
+
return UseSenseModule.getSdkVersion();
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
export default UseSense;
|
|
172
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["NativeModules","NativeEventEmitter","UseSenseModule","Error","eventEmitter","UseSense","initialize","config","apiKey","code","message","environment","organizationId","sessionType","identityId","challengePolicy","enableAudio","timeout","metadata","startSession","options","cancelSession","getSessionStatus","sessionId","addListener","callback","subscribeToEvents","subscription","remove","unsubscribeFromEvents","getSdkVersion"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":"AAAA,SAASA,aAAa,EAAEC,kBAAkB,QAAQ,cAAc;AAEhE,MAAM;EAAEC;AAAe,CAAC,GAAGF,aAAa;AAExC,IAAI,CAACE,cAAc,EAAE;EACnB,MAAM,IAAIC,KAAK,CACb,mGAAmG,GACjG,oCAAoC,GACpC,wDACJ,CAAC;AACH;;AAEA;;AAEA;;AAGA;;AAGA;;AAGA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAsBA;AACA;AACA;AACA;AACA;AACA;;AAwBA;AACA;AACA;;AAUA;AACA;AACA;;AASA;;AAQA;;AAQA;;AAMA;;AAEA,MAAMC,YAAY,GAAG,IAAIH,kBAAkB,CAACC,cAAc,CAAC;;AAE3D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,QAAQ,CAAC;EACpB;AACF;AACA;AACA;AACA;AACA;EACE,aAAaC,UAAUA,CAACC,MAAsB,EAAiB;IAC7D,IAAI,CAACA,MAAM,CAACC,MAAM,EAAE;MAClB,MAAM;QAAEC,IAAI,EAAE,gBAAgB;QAAEC,OAAO,EAAE;MAAqB,CAAC;IACjE;IACA,OAAOR,cAAc,CAACI,UAAU,CAAC;MAC/BE,MAAM,EAAED,MAAM,CAACC,MAAM;MACrBG,WAAW,EAAEJ,MAAM,CAACI,WAAW,IAAI,SAAS;MAC5CC,cAAc,EAAEL,MAAM,CAACK,cAAc;MACrCC,WAAW,EAAEN,MAAM,CAACM,WAAW,IAAI,YAAY;MAC/CC,UAAU,EAAEP,MAAM,CAACO,UAAU;MAC7BC,eAAe,EAAER,MAAM,CAACQ,eAAe,IAAI,UAAU;MACrDC,WAAW,EAAET,MAAM,CAACS,WAAW,IAAI,KAAK;MACxCC,OAAO,EAAEV,MAAM,CAACU,OAAO,IAAI,KAAK;MAChCC,QAAQ,EAAEX,MAAM,CAACW;IACnB,CAAC,CAAC;EACJ;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,aAAaC,YAAYA,CAACC,OAA6B,EAA2B;IAChF,OAAOlB,cAAc,CAACiB,YAAY,CAACC,OAAO,IAAI,CAAC,CAAC,CAAC;EACnD;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,aAAaC,aAAaA,CAAA,EAAkB;IAC1C,OAAOnB,cAAc,CAACmB,aAAa,CAAC,CAAC;EACvC;;EAEA;AACF;AACA;AACA;AACA;AACA;EACE,aAAaC,gBAAgBA,CAACC,SAAiB,EAA0B;IACvE,OAAOrB,cAAc,CAACoB,gBAAgB,CAACC,SAAS,CAAC;EACnD;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOC,WAAWA,CAACC,QAAwC,EAAwB;IACjFvB,cAAc,CAACwB,iBAAiB,CAAC,CAAC;IAClC,MAAMC,YAAY,GAAGvB,YAAY,CAACoB,WAAW,CAAC,eAAe,EAAEC,QAAQ,CAAC;IACxE,OAAO;MACLG,MAAM,EAAEA,CAAA,KAAM;QACZD,YAAY,CAACC,MAAM,CAAC,CAAC;QACrB1B,cAAc,CAAC2B,qBAAqB,CAAC,CAAC;MACxC;IACF,CAAC;EACH;;EAEA;AACF;AACA;AACA;AACA;EACE,OAAOC,aAAaA,CAAA,EAAW;IAC7B,OAAO5B,cAAc,CAAC4B,aAAa,CAAC,CAAC;EACvC;AACF;AAEA,eAAezB,QAAQ","ignoreList":[]}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/** Environment for the UseSense API. */
|
|
2
|
+
export type UseSenseEnvironment = 'production' | 'sandbox';
|
|
3
|
+
/** Session type for verification. */
|
|
4
|
+
export type SessionType = 'enrollment' | 'authentication';
|
|
5
|
+
/** Challenge policy controlling verification difficulty. */
|
|
6
|
+
export type ChallengePolicy = 'standard' | 'enhanced' | 'adaptive';
|
|
7
|
+
/** Decision returned by the verification engine. */
|
|
8
|
+
export type UseSenseDecision = 'approved' | 'rejected' | 'manual_review';
|
|
9
|
+
/** Processing stage during server-side analysis. */
|
|
10
|
+
export type ProcessingStage = 'deepsense' | 'livesense' | 'matchsense' | 'fusion';
|
|
11
|
+
/**
|
|
12
|
+
* Configuration for initializing the UseSense plugin.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* await UseSense.initialize({
|
|
17
|
+
* apiKey: 'your_api_key',
|
|
18
|
+
* environment: 'sandbox',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export interface UseSenseConfig {
|
|
23
|
+
/** API key from the UseSense dashboard. */
|
|
24
|
+
apiKey: string;
|
|
25
|
+
/** Target environment. Defaults to `'sandbox'`. */
|
|
26
|
+
environment?: UseSenseEnvironment;
|
|
27
|
+
/** Your organization ID (optional, inferred from API key). */
|
|
28
|
+
organizationId?: string;
|
|
29
|
+
/** Default session type. Defaults to `'enrollment'`. */
|
|
30
|
+
sessionType?: SessionType;
|
|
31
|
+
/** Identity ID for authentication sessions. */
|
|
32
|
+
identityId?: string;
|
|
33
|
+
/** Challenge difficulty policy. Defaults to `'standard'`. */
|
|
34
|
+
challengePolicy?: ChallengePolicy;
|
|
35
|
+
/** Enable audio capture for voice deepfake detection. Defaults to `false`. */
|
|
36
|
+
enableAudio?: boolean;
|
|
37
|
+
/** Maximum session duration in milliseconds. Defaults to `60000`. */
|
|
38
|
+
timeout?: number;
|
|
39
|
+
/** Custom key-value pairs attached to the session. */
|
|
40
|
+
metadata?: Record<string, string>;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Result returned when a verification session completes.
|
|
44
|
+
*
|
|
45
|
+
* **Important:** This result is for UI feedback only.
|
|
46
|
+
* The definitive verdict arrives at your backend via HMAC-signed webhook.
|
|
47
|
+
*/
|
|
48
|
+
export interface UseSenseResult {
|
|
49
|
+
/** Unique session identifier. */
|
|
50
|
+
sessionId: string;
|
|
51
|
+
/** Verification decision. */
|
|
52
|
+
decision: UseSenseDecision;
|
|
53
|
+
/** DeepSense channel trust score (0-100). */
|
|
54
|
+
channelTrustScore: number;
|
|
55
|
+
/** LiveSense liveness score (0-100). */
|
|
56
|
+
livenessScore: number;
|
|
57
|
+
/** MatchSense risk score (0-100). Lower is better. */
|
|
58
|
+
matchSenseRiskScore: number;
|
|
59
|
+
/** Fused presence confidence score (0-100). */
|
|
60
|
+
presenceConfidence: number;
|
|
61
|
+
/** Reasons contributing to the decision. */
|
|
62
|
+
reasons: string[];
|
|
63
|
+
/** Rule that triggered the decision, if any. */
|
|
64
|
+
ruleTriggered?: string;
|
|
65
|
+
/** Recommended action for the integrator. */
|
|
66
|
+
recommendedAction?: string;
|
|
67
|
+
/** Cryptographic signature for result verification. */
|
|
68
|
+
sessionSignature: string;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Error returned when a verification session fails.
|
|
72
|
+
*/
|
|
73
|
+
export interface UseSenseError {
|
|
74
|
+
/** Machine-readable error code. */
|
|
75
|
+
code: string;
|
|
76
|
+
/** Human-readable error message. */
|
|
77
|
+
message: string;
|
|
78
|
+
/** Additional error details. */
|
|
79
|
+
details?: Record<string, any>;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Events emitted during the verification session lifecycle.
|
|
83
|
+
*/
|
|
84
|
+
export type UseSenseEvent = {
|
|
85
|
+
type: 'session_started';
|
|
86
|
+
sessionId: string;
|
|
87
|
+
} | {
|
|
88
|
+
type: 'challenge_presented';
|
|
89
|
+
challengeType: string;
|
|
90
|
+
} | {
|
|
91
|
+
type: 'challenge_completed';
|
|
92
|
+
challengeType: string;
|
|
93
|
+
} | {
|
|
94
|
+
type: 'processing';
|
|
95
|
+
stage: ProcessingStage;
|
|
96
|
+
} | {
|
|
97
|
+
type: 'session_completed';
|
|
98
|
+
result: UseSenseResult;
|
|
99
|
+
} | {
|
|
100
|
+
type: 'session_error';
|
|
101
|
+
error: UseSenseError;
|
|
102
|
+
};
|
|
103
|
+
/** Options for starting a verification session. */
|
|
104
|
+
export interface StartSessionOptions {
|
|
105
|
+
/** Session type. Overrides the value set in {@link UseSenseConfig}. */
|
|
106
|
+
sessionType?: SessionType;
|
|
107
|
+
/** Identity ID for authentication sessions. */
|
|
108
|
+
identityId?: string;
|
|
109
|
+
}
|
|
110
|
+
/** Status of a verification session. */
|
|
111
|
+
export interface SessionStatus {
|
|
112
|
+
/** Current session status. */
|
|
113
|
+
status: string;
|
|
114
|
+
/** Result, if the session has completed. */
|
|
115
|
+
result?: UseSenseResult;
|
|
116
|
+
}
|
|
117
|
+
/** Subscription handle returned by {@link UseSense.addListener}. */
|
|
118
|
+
export interface UseSenseSubscription {
|
|
119
|
+
/** Remove the event listener. */
|
|
120
|
+
remove: () => void;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* UseSense React Native plugin.
|
|
124
|
+
*
|
|
125
|
+
* Provides human presence verification by wrapping the native UseSense
|
|
126
|
+
* iOS and Android SDKs into a single cross-platform API.
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
* ```ts
|
|
130
|
+
* import { UseSense } from 'react-native-usesense';
|
|
131
|
+
*
|
|
132
|
+
* await UseSense.initialize({ apiKey: 'your_key', environment: 'sandbox' });
|
|
133
|
+
* const result = await UseSense.startSession({ sessionType: 'enrollment' });
|
|
134
|
+
* console.log(result.decision);
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
137
|
+
export declare class UseSense {
|
|
138
|
+
/**
|
|
139
|
+
* Initialize the UseSense plugin. Must be called once before any other method.
|
|
140
|
+
*
|
|
141
|
+
* @param config - Plugin configuration including API key and environment.
|
|
142
|
+
* @throws {UseSenseError} If the API key is invalid or configuration is malformed.
|
|
143
|
+
*/
|
|
144
|
+
static initialize(config: UseSenseConfig): Promise<void>;
|
|
145
|
+
/**
|
|
146
|
+
* Start a verification session. Presents a full-screen native camera UI.
|
|
147
|
+
*
|
|
148
|
+
* The returned promise resolves when the session completes and the modal
|
|
149
|
+
* dismisses, or rejects if an error occurs.
|
|
150
|
+
*
|
|
151
|
+
* @param options - Optional overrides for session type and identity ID.
|
|
152
|
+
* @returns The verification result (for UI feedback only).
|
|
153
|
+
* @throws {UseSenseError} On failure or cancellation.
|
|
154
|
+
*/
|
|
155
|
+
static startSession(options?: StartSessionOptions): Promise<UseSenseResult>;
|
|
156
|
+
/**
|
|
157
|
+
* Cancel an in-progress verification session.
|
|
158
|
+
*
|
|
159
|
+
* The camera UI is dismissed and the `startSession` promise rejects
|
|
160
|
+
* with a `session_cancelled` error.
|
|
161
|
+
*/
|
|
162
|
+
static cancelSession(): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Get the status of a verification session by ID.
|
|
165
|
+
*
|
|
166
|
+
* @param sessionId - The session ID to query.
|
|
167
|
+
* @returns The current status and optional result.
|
|
168
|
+
*/
|
|
169
|
+
static getSessionStatus(sessionId: string): Promise<SessionStatus>;
|
|
170
|
+
/**
|
|
171
|
+
* Subscribe to real-time events during the verification lifecycle.
|
|
172
|
+
*
|
|
173
|
+
* Call this before `startSession()` to receive all events.
|
|
174
|
+
*
|
|
175
|
+
* @param callback - Function invoked for each event.
|
|
176
|
+
* @returns A subscription handle with a `remove()` method.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* const listener = UseSense.addListener((event) => {
|
|
181
|
+
* console.log(event.type);
|
|
182
|
+
* });
|
|
183
|
+
* // Later:
|
|
184
|
+
* listener.remove();
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
static addListener(callback: (event: UseSenseEvent) => void): UseSenseSubscription;
|
|
188
|
+
/**
|
|
189
|
+
* Get the native SDK version string.
|
|
190
|
+
*
|
|
191
|
+
* @returns Version string in semver format (e.g. `"1.0.0"`).
|
|
192
|
+
*/
|
|
193
|
+
static getSdkVersion(): string;
|
|
194
|
+
}
|
|
195
|
+
export default UseSense;
|
|
196
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "react-native-usesense",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "React Native plugin for human presence verification. Wraps the native UseSense iOS and Android SDKs.",
|
|
5
|
+
"main": "lib/commonjs/index.js",
|
|
6
|
+
"module": "lib/module/index.js",
|
|
7
|
+
"types": "lib/typescript/src/index.d.ts",
|
|
8
|
+
"react-native": "src/index.ts",
|
|
9
|
+
"source": "src/index.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"src",
|
|
12
|
+
"lib",
|
|
13
|
+
"android",
|
|
14
|
+
"ios",
|
|
15
|
+
"react-native-usesense.podspec",
|
|
16
|
+
"README.md",
|
|
17
|
+
"LICENSE",
|
|
18
|
+
"!android/build",
|
|
19
|
+
"!ios/build",
|
|
20
|
+
"!**/__tests__",
|
|
21
|
+
"!**/*.test.ts",
|
|
22
|
+
"!**/*.test.tsx"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "bob build",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"lint": "eslint \"src/**/*.{ts,tsx}\"",
|
|
28
|
+
"test": "jest --passWithNoTests",
|
|
29
|
+
"prepare": "bob build",
|
|
30
|
+
"clean": "del-cli lib"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"react-native",
|
|
34
|
+
"usesense",
|
|
35
|
+
"identity-verification",
|
|
36
|
+
"kyc",
|
|
37
|
+
"aml",
|
|
38
|
+
"liveness",
|
|
39
|
+
"biometric",
|
|
40
|
+
"face-verification",
|
|
41
|
+
"deepfake-detection",
|
|
42
|
+
"presence-verification",
|
|
43
|
+
"turbo-module"
|
|
44
|
+
],
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "https://github.com/qudusadeyemi/react-native-usesense.git"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/qudusadeyemi/react-native-usesense#readme",
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/qudusadeyemi/react-native-usesense/issues"
|
|
52
|
+
},
|
|
53
|
+
"author": "UseSense Technologies Ltd.",
|
|
54
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"peerDependencies": {
|
|
59
|
+
"react": ">=18.2.0",
|
|
60
|
+
"react-native": ">=0.73.0"
|
|
61
|
+
},
|
|
62
|
+
"devDependencies": {
|
|
63
|
+
"@types/react": "^18.2.0",
|
|
64
|
+
"@typescript-eslint/eslint-plugin": "^7.0.0",
|
|
65
|
+
"@typescript-eslint/parser": "^7.0.0",
|
|
66
|
+
"del-cli": "^5.1.0",
|
|
67
|
+
"eslint": "^8.57.0",
|
|
68
|
+
"jest": "^29.7.0",
|
|
69
|
+
"react": "^18.2.0",
|
|
70
|
+
"react-native": "^0.73.0",
|
|
71
|
+
"react-native-builder-bob": "^0.23.0",
|
|
72
|
+
"typescript": "^5.3.0"
|
|
73
|
+
},
|
|
74
|
+
"codegenConfig": {
|
|
75
|
+
"name": "RNUseSenseSpec",
|
|
76
|
+
"type": "modules",
|
|
77
|
+
"jsSrcsDir": "src"
|
|
78
|
+
},
|
|
79
|
+
"react-native-builder-bob": {
|
|
80
|
+
"source": "src",
|
|
81
|
+
"output": "lib",
|
|
82
|
+
"targets": [
|
|
83
|
+
"commonjs",
|
|
84
|
+
"module",
|
|
85
|
+
[
|
|
86
|
+
"typescript",
|
|
87
|
+
{
|
|
88
|
+
"project": "tsconfig.build.json"
|
|
89
|
+
}
|
|
90
|
+
]
|
|
91
|
+
]
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
require "json"
|
|
2
|
+
|
|
3
|
+
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
|
4
|
+
|
|
5
|
+
Pod::Spec.new do |s|
|
|
6
|
+
s.name = "react-native-usesense"
|
|
7
|
+
s.version = package["version"]
|
|
8
|
+
s.summary = package["description"]
|
|
9
|
+
s.homepage = package["homepage"]
|
|
10
|
+
s.license = { :type => "Proprietary", :file => "LICENSE" }
|
|
11
|
+
s.authors = { "UseSense Technologies Ltd." => "support@usesense.ai" }
|
|
12
|
+
s.source = { :git => package["repository"]["url"], :tag => "v#{s.version}" }
|
|
13
|
+
|
|
14
|
+
s.platforms = { :ios => "14.0" }
|
|
15
|
+
s.swift_version = "5.9"
|
|
16
|
+
|
|
17
|
+
s.source_files = "ios/**/*.{swift,h,m}"
|
|
18
|
+
|
|
19
|
+
# React Native dependency (supports both old and new architecture)
|
|
20
|
+
install_modules_dependencies(s)
|
|
21
|
+
|
|
22
|
+
# Native UseSense iOS SDK
|
|
23
|
+
s.dependency "UseSenseSDK", "~> 1.0"
|
|
24
|
+
end
|