@switchlabs/verify-ai-react-native 2.4.20 → 2.4.21

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.
@@ -22,7 +22,7 @@ function enrichMetadata(metadata) {
22
22
  export class VerifyAIClient {
23
23
  constructor(config) {
24
24
  if (!config.apiKey) {
25
- throw new Error('VerifyAI: apiKey is required');
25
+ throw new Error(`VerifyAI[v${SDK_VERSION}]: apiKey is required`);
26
26
  }
27
27
  this.apiKey = config.apiKey;
28
28
  this.baseUrl = (config.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, '');
@@ -95,7 +95,7 @@ export class VerifyAIClient {
95
95
  });
96
96
  }
97
97
  if (!body || typeof body !== 'object') {
98
- throw this.buildRequestError('VerifyAI: Invalid response payload', 0, context, {
98
+ throw this.buildRequestError(`VerifyAI[v${SDK_VERSION}]: Invalid response payload`, 0, context, {
99
99
  code: 'invalid_response',
100
100
  request_id: response.headers.get('X-Request-Id') || undefined,
101
101
  });
@@ -3,6 +3,7 @@ import { AppState, Platform } from 'react-native';
3
3
  import { VerifyAIClient, VerifyAIRequestError } from '../client';
4
4
  import { OfflineQueue } from '../storage/offlineQueue';
5
5
  import { TelemetryContext } from '../telemetry/TelemetryContext';
6
+ import { SDK_VERSION } from '../version';
6
7
  function isQueueableError(error) {
7
8
  if (error instanceof VerifyAIRequestError) {
8
9
  return error.isRetryable;
@@ -86,7 +87,7 @@ export function useVerifyAI(config) {
86
87
  inferenceEngineRef.current = new InferenceEngine();
87
88
  }
88
89
  catch (err) {
89
- console.warn('[VerifyAI] Failed to load ML modules:', err);
90
+ console.warn(`[VerifyAI v${SDK_VERSION}] Failed to load ML modules:`, err);
90
91
  }
91
92
  })();
92
93
  return () => {
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { Buffer } from 'buffer';
6
6
  import { sha256 } from '@noble/hashes/sha2.js';
7
+ import { SDK_VERSION } from '../version';
7
8
  async function loadFileSystem() {
8
9
  try {
9
10
  return await import('expo-file-system');
@@ -68,7 +69,7 @@ export class ModelManager {
68
69
  async downloadArtifacts(manifest, policyId) {
69
70
  const fileSystem = await loadFileSystem();
70
71
  if (!fileSystem || !fileSystem.documentDirectory) {
71
- console.warn('[VerifyAI] expo-file-system not available, skipping download');
72
+ console.warn(`[VerifyAI v${SDK_VERSION}] expo-file-system not available, skipping download`);
72
73
  return;
73
74
  }
74
75
  const cacheDir = `${fileSystem.documentDirectory}verify-ai/bundles/${policyId}/`;
package/lib/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.4.20";
1
+ export declare const SDK_VERSION = "2.4.21";
package/lib/version.js CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = '2.4.20';
1
+ export const SDK_VERSION = '2.4.21';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@switchlabs/verify-ai-react-native",
3
- "version": "2.4.20",
3
+ "version": "2.4.21",
4
4
  "description": "React Native SDK for Verify AI - photo verification with AI vision processing",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -48,7 +48,7 @@ export class VerifyAIClient {
48
48
 
49
49
  constructor(config: VerifyAIConfig) {
50
50
  if (!config.apiKey) {
51
- throw new Error('VerifyAI: apiKey is required');
51
+ throw new Error(`VerifyAI[v${SDK_VERSION}]: apiKey is required`);
52
52
  }
53
53
  this.apiKey = config.apiKey;
54
54
  this.baseUrl = (config.baseUrl || DEFAULT_BASE_URL).replace(/\/$/, '');
@@ -147,7 +147,7 @@ export class VerifyAIClient {
147
147
 
148
148
  if (!body || typeof body !== 'object') {
149
149
  throw this.buildRequestError(
150
- 'VerifyAI: Invalid response payload',
150
+ `VerifyAI[v${SDK_VERSION}]: Invalid response payload`,
151
151
  0,
152
152
  context,
153
153
  {
@@ -4,6 +4,7 @@ import { VerifyAIClient, VerifyAIRequestError } from '../client';
4
4
  import { OfflineQueue } from '../storage/offlineQueue';
5
5
  import { TelemetryContext } from '../telemetry/TelemetryContext';
6
6
  import type { TelemetryReporter } from '../telemetry/TelemetryReporter';
7
+ import { SDK_VERSION } from '../version';
7
8
  import type {
8
9
  VerifyAIConfig,
9
10
  VerificationRequest,
@@ -161,7 +162,7 @@ export function useVerifyAI(config: UseVerifyAIConfig): UseVerifyAIReturn {
161
162
  });
162
163
  inferenceEngineRef.current = new InferenceEngine();
163
164
  } catch (err) {
164
- console.warn('[VerifyAI] Failed to load ML modules:', err);
165
+ console.warn(`[VerifyAI v${SDK_VERSION}] Failed to load ML modules:`, err);
165
166
  }
166
167
  })();
167
168
 
@@ -6,6 +6,7 @@
6
6
  import { Buffer } from 'buffer';
7
7
  import { sha256 } from '@noble/hashes/sha2.js';
8
8
  import type { BundleManifest, ModelArtifact } from './types';
9
+ import { SDK_VERSION } from '../version';
9
10
 
10
11
  export type { BundleManifest, ModelArtifact };
11
12
 
@@ -113,7 +114,7 @@ export class ModelManager {
113
114
  private async downloadArtifacts(manifest: BundleManifest, policyId: string): Promise<void> {
114
115
  const fileSystem = await loadFileSystem();
115
116
  if (!fileSystem || !fileSystem.documentDirectory) {
116
- console.warn('[VerifyAI] expo-file-system not available, skipping download');
117
+ console.warn(`[VerifyAI v${SDK_VERSION}] expo-file-system not available, skipping download`);
117
118
  return;
118
119
  }
119
120
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const SDK_VERSION = '2.4.20';
1
+ export const SDK_VERSION = '2.4.21';