react-native-usesense 1.0.0 → 2.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.
@@ -1,196 +1,212 @@
1
- /** Environment for the UseSense API. */
2
- export type UseSenseEnvironment = 'production' | 'sandbox';
3
- /** Session type for verification. */
1
+ /**
2
+ * Target environment for the UseSense API. `auto` asks the native SDK
3
+ * to detect from the API key prefix (`sk_sandbox_*` → sandbox,
4
+ * `sk_prod_*` → production).
5
+ */
6
+ export type UseSenseEnvironment = 'sandbox' | 'production' | 'auto';
7
+ /** Type of verification session. */
4
8
  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
9
  /**
12
- * Configuration for initializing the UseSense plugin.
10
+ * Decision returned by the native SDK.
13
11
  *
14
- * @example
15
- * ```ts
16
- * await UseSense.initialize({
17
- * apiKey: 'your_api_key',
18
- * environment: 'sandbox',
19
- * });
20
- * ```
12
+ * These values come straight from the server's verdict and are
13
+ * exposed to the integrator for UI feedback only. The definitive
14
+ * verdict arrives at your backend via an HMAC-signed webhook; never
15
+ * trust the client-side decision for access-control.
16
+ */
17
+ export type Decision = 'APPROVE' | 'REJECT' | 'MANUAL_REVIEW';
18
+ /**
19
+ * Branding overrides applied to the native camera UI.
20
+ *
21
+ * - `logoUrl`, `primaryColor`, `buttonRadius`, `fontFamily` are
22
+ * honoured on both iOS and Android.
23
+ * - `displayName`, `redirectUrl` are Android-only fields. They're
24
+ * accepted on iOS for cross-platform API parity but ignored.
25
+ */
26
+ export interface BrandingConfig {
27
+ logoUrl?: string;
28
+ primaryColor?: string;
29
+ buttonRadius?: number;
30
+ fontFamily?: string;
31
+ displayName?: string;
32
+ redirectUrl?: string;
33
+ }
34
+ /**
35
+ * Configuration for `UseSense.initialize`. The minimum required
36
+ * field is the API key; every other field has a sensible default.
21
37
  */
22
38
  export interface UseSenseConfig {
23
- /** API key from the UseSense dashboard. */
39
+ /** API key from watchtower.usesense.ai. */
24
40
  apiKey: string;
25
- /** Target environment. Defaults to `'sandbox'`. */
41
+ /** Target environment. Defaults to `auto` (detected from key prefix). */
26
42
  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. */
43
+ /**
44
+ * Override the API endpoint. Defaults to `https://api.usesense.ai/v1`.
45
+ * Only set this if you're pointing at a staging or self-hosted
46
+ * proxy. Maps to `apiEndpoint` on iOS and `baseUrl` on Android
47
+ * under the hood.
48
+ */
49
+ apiEndpoint?: string;
50
+ /** SDK-level branding overrides. */
51
+ branding?: BrandingConfig;
52
+ }
53
+ /**
54
+ * Request to start a verification session.
55
+ */
56
+ export interface VerificationRequest {
57
+ sessionType: SessionType;
58
+ /** Your internal user identifier (optional, stored in session metadata). */
59
+ externalUserId?: string;
60
+ /**
61
+ * Required for `authentication` sessions. The previously-enrolled
62
+ * identity you're verifying against.
63
+ */
32
64
  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
65
  /** Custom key-value pairs attached to the session. */
40
- metadata?: Record<string, string>;
66
+ metadata?: Record<string, string | number | boolean>;
41
67
  }
42
68
  /**
43
- * Result returned when a verification session completes.
69
+ * Redacted decision object returned when a session completes.
44
70
  *
45
- * **Important:** This result is for UI feedback only.
46
- * The definitive verdict arrives at your backend via HMAC-signed webhook.
71
+ * This is the ONLY shape the plugin exposes to React Native. Pillar
72
+ * scores (channel trust, liveness, matchsense risk) are intentionally
73
+ * not included — the native SDKs strip those fields before returning
74
+ * across the bridge to prevent reverse-engineering of the server-side
75
+ * scoring logic. If you need full scoring details, consume the signed
76
+ * webhook delivered to your backend.
47
77
  */
48
78
  export interface UseSenseResult {
49
- /** Unique session identifier. */
50
79
  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;
80
+ sessionType: string | null;
81
+ identityId: string | null;
82
+ decision: Decision;
83
+ timestamp: string;
84
+ /** Convenience: `decision === 'APPROVE'`. */
85
+ isApproved: boolean;
86
+ /** Convenience: `decision === 'REJECT'`. */
87
+ isRejected: boolean;
88
+ /** Convenience: `decision === 'MANUAL_REVIEW'`. */
89
+ isPendingReview: boolean;
69
90
  }
70
91
  /**
71
- * Error returned when a verification session fails.
92
+ * Error thrown when a verification session fails.
93
+ *
94
+ * Matches the native SDKs' error shape: machine-readable code,
95
+ * human-readable message, retry hint.
72
96
  */
73
97
  export interface UseSenseError {
74
- /** Machine-readable error code. */
98
+ /**
99
+ * Machine-readable error code. One of
100
+ * `CAMERA_UNAVAILABLE`, `CAMERA_PERMISSION_DENIED`,
101
+ * `MIC_PERMISSION_DENIED`, `NETWORK_ERROR`, `NETWORK_TIMEOUT`,
102
+ * `SESSION_EXPIRED`, `UNAUTHORIZED`, `INVALID_TOKEN`,
103
+ * `SESSION_NOT_FOUND`, `IDENTITY_NOT_FOUND`, `INVALID_REQUEST`,
104
+ * `INVALID_CONFIG`, `QUOTA_EXCEEDED`, `USER_CANCELLED`,
105
+ * `session_cancelled`, `sdk_not_initialized`, `no_view_controller`,
106
+ * `CAPTURE_FAILED`, `ENCODING_FAILED`, `UPLOAD_FAILED`,
107
+ * `FACE_NOT_DETECTED`, `LOW_LIGHT`, `TIMEOUT`, `SERVER_ERROR`,
108
+ * `SERVICE_UNAVAILABLE`, `TOKEN_EXPIRED`, `TOKEN_ALREADY_USED`,
109
+ * `INSUFFICIENT_CREDITS`, `NONCE_MISMATCH`, `UNKNOWN_ERROR`.
110
+ */
75
111
  code: string;
76
112
  /** Human-readable error message. */
77
113
  message: string;
78
- /** Additional error details. */
79
- details?: Record<string, any>;
114
+ /** Whether the operation can be retried. */
115
+ isRetryable?: boolean;
116
+ /** Server-specific error code, if any. */
117
+ serverCode?: string;
80
118
  }
81
119
  /**
82
- * Events emitted during the verification session lifecycle.
120
+ * Lifecycle event types emitted by the native SDK during a
121
+ * verification session.
83
122
  */
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;
123
+ export type UseSenseEventType = 'SESSION_CREATED' | 'PERMISSIONS_REQUESTED' | 'PERMISSIONS_GRANTED' | 'PERMISSIONS_DENIED' | 'CAPTURE_STARTED' | 'FRAME_CAPTURED' | 'CAPTURE_COMPLETED' | 'AUDIO_RECORD_STARTED' | 'AUDIO_RECORD_COMPLETED' | 'CHALLENGE_STARTED' | 'CHALLENGE_COMPLETED' | 'UPLOAD_STARTED' | 'UPLOAD_PROGRESS' | 'UPLOAD_COMPLETED' | 'COMPLETE_STARTED' | 'DECISION_RECEIVED' | 'IMAGE_QUALITY_CHECK' | 'ERROR' | 'UNKNOWN';
124
+ /** Single event emitted during a session. */
125
+ export interface UseSenseEvent {
126
+ type: UseSenseEventType;
127
+ /** Unix epoch milliseconds. */
128
+ timestamp: number;
129
+ /** Event-specific payload. Opaque strings; never contains scoring data. */
130
+ data?: Record<string, string>;
116
131
  }
117
- /** Subscription handle returned by {@link UseSense.addListener}. */
132
+ /** Handle returned by `UseSense.addListener`. */
118
133
  export interface UseSenseSubscription {
119
- /** Remove the event listener. */
120
- remove: () => void;
134
+ remove(): void;
121
135
  }
122
136
  /**
123
137
  * UseSense React Native plugin.
124
138
  *
125
- * Provides human presence verification by wrapping the native UseSense
126
- * iOS and Android SDKs into a single cross-platform API.
139
+ * Human presence verification wrapping the native iOS and Android
140
+ * UseSense SDKs. Every session runs inside a full-screen native
141
+ * camera activity; the plugin is a thin bridge that forwards
142
+ * initialization, verification requests, and lifecycle events to
143
+ * the platform SDK and returns a redacted decision object.
127
144
  *
128
145
  * @example
129
146
  * ```ts
130
147
  * import { UseSense } from 'react-native-usesense';
131
148
  *
132
- * await UseSense.initialize({ apiKey: 'your_key', environment: 'sandbox' });
133
- * const result = await UseSense.startSession({ sessionType: 'enrollment' });
134
- * console.log(result.decision);
149
+ * await UseSense.initialize({
150
+ * apiKey: 'sk_sandbox_...',
151
+ * environment: 'sandbox',
152
+ * });
153
+ *
154
+ * const unsubscribe = UseSense.addListener((event) => {
155
+ * console.log(event.type, event.data);
156
+ * });
157
+ *
158
+ * try {
159
+ * const result = await UseSense.startVerification({
160
+ * sessionType: 'enrollment',
161
+ * });
162
+ * console.log(result.decision); // 'APPROVE' | 'REJECT' | 'MANUAL_REVIEW'
163
+ * } finally {
164
+ * unsubscribe.remove();
165
+ * }
135
166
  * ```
136
167
  */
137
168
  export declare class UseSense {
138
169
  /**
139
- * Initialize the UseSense plugin. Must be called once before any other method.
170
+ * Initialize the UseSense plugin. Must be called before any other
171
+ * method. Calling again with a different API key or environment
172
+ * replaces the previous configuration.
140
173
  *
141
- * @param config - Plugin configuration including API key and environment.
142
- * @throws {UseSenseError} If the API key is invalid or configuration is malformed.
174
+ * @throws {UseSenseError} If the API key is empty or initialization
175
+ * fails on the native side.
143
176
  */
144
177
  static initialize(config: UseSenseConfig): Promise<void>;
145
178
  /**
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.
179
+ * Start a verification session. Presents a full-screen native
180
+ * camera activity. The returned promise resolves when the session
181
+ * completes or rejects with a `UseSenseError` (including the
182
+ * `USER_CANCELLED` / `session_cancelled` cases when the user
183
+ * dismisses the camera screen).
154
184
  */
155
- static startSession(options?: StartSessionOptions): Promise<UseSenseResult>;
185
+ static startVerification(request: VerificationRequest): Promise<UseSenseResult>;
156
186
  /**
157
- * Cancel an in-progress verification session.
187
+ * Subscribe to real-time lifecycle events emitted by the native
188
+ * SDK during a verification session. Call this **before**
189
+ * `startVerification` so the subscription captures the earliest
190
+ * events (`SESSION_CREATED`, `PERMISSIONS_REQUESTED`).
158
191
  *
159
- * The camera UI is dismissed and the `startSession` promise rejects
160
- * with a `session_cancelled` error.
192
+ * Returns a subscription handle; call `.remove()` to stop
193
+ * receiving events.
161
194
  */
162
- static cancelSession(): Promise<void>;
195
+ static addListener(callback: (event: UseSenseEvent) => void): UseSenseSubscription;
163
196
  /**
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.
197
+ * Clear all event listeners and release native resources. Does not
198
+ * need to be called explicitly during normal usage; the plugin
199
+ * cleans up on process teardown. Useful when you want to re-
200
+ * initialize against a different API key or during test teardown.
168
201
  */
169
- static getSessionStatus(sessionId: string): Promise<SessionStatus>;
202
+ static reset(): Promise<void>;
170
203
  /**
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"`).
204
+ * Whether the native plugin has an active `UseSense` client. Set
205
+ * to `true` after a successful `initialize` and `false` after
206
+ * `reset`. Useful for feature-flagging UI that should only show
207
+ * when the SDK is ready.
192
208
  */
193
- static getSdkVersion(): string;
209
+ static isInitialized(): Promise<boolean>;
194
210
  }
195
211
  export default UseSense;
196
212
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAcA,wCAAwC;AACxC,MAAM,MAAM,mBAAmB,GAAG,YAAY,GAAG,SAAS,CAAC;AAE3D,qCAAqC;AACrC,MAAM,MAAM,WAAW,GAAG,YAAY,GAAG,gBAAgB,CAAC;AAE1D,4DAA4D;AAC5D,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,UAAU,GAAG,UAAU,CAAC;AAEnE,oDAAoD;AACpD,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,CAAC;AAEzE,oDAAoD;AACpD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG,WAAW,GAAG,YA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2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B;AAED,iDAAiD;AACjD,MAAM,WAAW,oBAAoB;IACnC,MAAM,IAAI,IAAI,CAAC;CAChB;AAMD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,qBAAa,QAAQ;IACnB;;;;;;;OAOG;WACU,UAAU,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAiB9D;;;;;;OAMG;WACU,iBAAiB,CAC5B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,cAAc,CAAC;IAS1B;;;;;;;;OAQG;IACH,MAAM,CAAC,WAAW,CAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,GACvC,oBAAoB;IAYvB;;;;;OAKG;WACU,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAInC;;;;;OAKG;WACU,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC;CAG/C;AAED,eAAe,QAAQ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-usesense",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "React Native plugin for human presence verification. Wraps the native UseSense iOS and Android SDKs.",
5
5
  "main": "lib/commonjs/index.js",
6
6
  "module": "lib/module/index.js",
@@ -11,7 +11,9 @@ Pod::Spec.new do |s|
11
11
  s.authors = { "UseSense Technologies Ltd." => "support@usesense.ai" }
12
12
  s.source = { :git => package["repository"]["url"], :tag => "v#{s.version}" }
13
13
 
14
- s.platforms = { :ios => "14.0" }
14
+ # Minimum iOS 15.0 to match the native UseSense iOS SDK's floor
15
+ # (v4.x uses SwiftUI features that require iOS 15.0 and up).
16
+ s.platforms = { :ios => "15.0" }
15
17
  s.swift_version = "5.9"
16
18
 
17
19
  s.source_files = "ios/**/*.{swift,h,m}"
@@ -19,6 +21,10 @@ Pod::Spec.new do |s|
19
21
  # React Native dependency (supports both old and new architecture)
20
22
  install_modules_dependencies(s)
21
23
 
22
- # Native UseSense iOS SDK
23
- s.dependency "UseSenseSDK", "~> 1.0"
24
+ # Native UseSense iOS SDK. Minimum 4.2.2 — earlier 4.x releases had
25
+ # terminal-screen centering bugs, and the 1.x series used a pre-
26
+ # redaction result type with a completely different UseSenseConfig
27
+ # init signature. See CHANGELOG [2.0.0] for the full rewrite
28
+ # rationale.
29
+ s.dependency "UseSenseSDK", "~> 4.2"
24
30
  end