@humansecurity/expo-mobile-sdk 1.0.6 → 1.0.9

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/CHANGELOG.md CHANGED
@@ -1,6 +1,16 @@
1
1
  # Changelog
2
2
  For Expo wrapper versions
3
3
 
4
+ ## [1.0.8] - 12-11-2025
5
+ ### Moved the AAR out of the wrapper package and added inclusion via the Gradle plugin file; updated docs and plugin setup accordingly.
6
+
7
+ ## [1.0.6] - 25-09-2025
8
+ ### Updated wrapper version to Expo 54 and native sdk version 4.2.0 to include new human_session.
9
+ - Expo version: "^54.0.9"
10
+ - react-native: "0.81.4" - "react": "^19.1.0"
11
+ - iOS SDK version: 4.2.0
12
+ - Android SDK version: 4.2.1 - (built with Kotlin 2.x & Ktor 3.x)
13
+
4
14
  ## [1.0.5] - 09-09-2025
5
15
  ### Updated wrapper version to Expo 53 and native sdk version 4.2.0 to include new human_session.
6
16
  - Expo version: "^53.0.0"
package/README.md CHANGED
@@ -1,17 +1,42 @@
1
1
  # expo-mobile-sdk
2
2
 
3
- A model implementing our native SDK's with the expo framework.
3
+ A module implementing our native SDKs for the Expo framework.
4
4
 
5
5
  # API documentation
6
6
 
7
+ The full Documentation and usage examples can be found at our [official site](https://docs.humansecurity.com/applications-and-accounts/docs/expo-integration).
8
+
7
9
  # Installation in managed Expo projects -
8
10
  From the terminal run:
9
11
 
12
+ ```
13
+ npm install @humansecurity/expo-mobile-sdk
14
+ ```
15
+ Then add the config plugin to your app.json (or app.config.js) so the Android dependency repository is automatically configured:
16
+
17
+ ```
18
+ {
19
+ "expo": {
20
+ "plugins": [
21
+ "@humansecurity/expo-mobile-sdk"
22
+ ]
23
+ }
24
+ }
25
+ ```
26
+
27
+ **Note:**
28
+ The config plugin is available starting from **version 1.0.8 and later**.
29
+ If you are using an earlier version (**1.0.2–1.0.6**), **do not add** the plugin line — simply run:
10
30
  ```
11
31
  npm install @humansecurity/expo-mobile-sdk
12
32
  npx expo prebuild
13
33
  ```
14
34
 
35
+ Finally, run the prebuild command:
36
+ ```
37
+ npx expo prebuild
38
+ ```
39
+
15
40
  ### Usage example
16
41
 
17
42
  ```
@@ -21,7 +46,6 @@ import { HumanSecurity } from '@humansecurity/expo-mobile-sdk';
21
46
  <ThemedText type="title">{HumanSecurity.sdkVersion()}</ThemedText>
22
47
 
23
48
  ```
24
- The full Documentation and usage examples can be found at our [official site](https://docs.humansecurity.com/applications-and-accounts/docs/expo-integration).
25
49
 
26
50
  ### The current API:
27
51
 
@@ -45,6 +69,21 @@ The full Documentation and usage examples can be found at our [official site](ht
45
69
 
46
70
  ```
47
71
 
48
- # Installation in bare React Native projects
72
+ ## Installation in bare React Native projects
49
73
 
50
74
  For the react-native bare workflow projects see our [integration guide](https://docs.humansecurity.com/applications-and-accounts/docs/react-native-integration).
75
+
76
+ ## ⚠️ Note for Custom / Bare Workflows
77
+
78
+ If your project does not use expo prebuild, you must manually add the repository entry to your android/build.gradle file.
79
+ Make sure this block appears in every section where you define repositories:
80
+ ```
81
+ allprojects {
82
+ repositories {
83
+ // ... your existing repos
84
+ maven { url 'https://jfrog.humansecurity.com/artifactory/human-android-sdk/' }
85
+ }
86
+ }
87
+ ```
88
+ The config plugin automatically adds this during expo prebuild,
89
+ but in custom workflows, it must be added manually to ensure proper Android dependency resolution.
@@ -1,7 +1,31 @@
1
+ buildscript {
2
+ // Simple helper that allows the root project to override versions declared by this library.
3
+ ext.safeExtGet = { prop, fallback ->
4
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
5
+ }
6
+ repositories {
7
+ google()
8
+ mavenCentral()
9
+ maven {
10
+ url 'https://jfrog.humansecurity.com/artifactory/human-android-sdk/'
11
+ }
12
+ }
13
+ }
14
+
15
+ allprojects {
16
+ repositories {
17
+ google()
18
+ mavenCentral()
19
+ maven {
20
+ url 'https://jfrog.humansecurity.com/artifactory/human-android-sdk/'
21
+ }
22
+ }
23
+ }
24
+
1
25
  apply plugin: 'com.android.library'
2
26
 
3
27
  group = 'expo.modules.humansdk'
4
- version = '1.0.5'
28
+ version = '1.0.8'
5
29
 
6
30
  def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
7
31
  apply from: expoModulesCorePlugin
@@ -16,12 +40,6 @@ def useManagedAndroidSdkVersions = false
16
40
  if (useManagedAndroidSdkVersions) {
17
41
  useDefaultAndroidSdkVersions()
18
42
  } else {
19
- buildscript {
20
- // Simple helper that allows the root project to override versions declared by this library.
21
- ext.safeExtGet = { prop, fallback ->
22
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
23
- }
24
- }
25
43
  project.android {
26
44
  compileSdkVersion safeExtGet("compileSdkVersion", 34)
27
45
  defaultConfig {
@@ -32,20 +50,14 @@ if (useManagedAndroidSdkVersions) {
32
50
  }
33
51
 
34
52
  dependencies {
35
- implementation files('libs/HUMAN-4.2.1.aar')
36
- implementation("androidx.core:core-ktx:1.15.0") // any version (select 1.10.1 if your app has 'targetSdkVersion 33')
37
- implementation("androidx.lifecycle:lifecycle-process:2.8.7") // min v2.6.0 (select 2.6.2 if your app has 'targetSdkVersion 33')
38
- implementation("androidx.datastore:datastore-preferences:1.1.1") // any version (select 1.0.0 if your app targets API 33)
39
- implementation("com.google.android.material:material:1.12.0") // min v1.6.0 (select 1.9.0 if your app has 'targetSdkVersion 33')
40
- implementation("com.fasterxml.uuid:java-uuid-generator:4.3.0") // min v3.0.0
41
- implementation("io.ktor:ktor-client-okhttp:3.0.3") // min v3.0.0
53
+ implementation 'com.humansecurity:sdk:4.2.4'
42
54
  }
43
55
 
44
56
  android {
45
57
  namespace "expo.modules.humansdk"
46
58
  defaultConfig {
47
- versionCode 6
48
- versionName "1.0.6"
59
+ versionCode 8
60
+ versionName "1.0.8"
49
61
  }
50
62
  lintOptions {
51
63
  abortOnError false
package/app.plugin.js ADDED
@@ -0,0 +1,54 @@
1
+ // app.plugin.js
2
+ const { withProjectBuildGradle, WarningAggregator } = require('@expo/config-plugins');
3
+
4
+ const REPO_LINE = `maven { url 'https://jfrog.humansecurity.com/artifactory/human-android-sdk/' }`;
5
+ const REPO_MARKER = 'jfrog.humansecurity.com/artifactory/human-android-sdk';
6
+
7
+ function ensureInsideFirstRepositoriesBlock(block) {
8
+ if (block.includes(REPO_MARKER)) return block;
9
+ return block.replace(/repositories\s*\{/, (m) => `${m}\n ${REPO_LINE}`);
10
+ }
11
+
12
+ module.exports = function withHumanRepo(config) {
13
+ return withProjectBuildGradle(config, (cfg) => {
14
+ let src = cfg.modResults.contents;
15
+ const before = src;
16
+
17
+ // 1) buildscript.repositories
18
+ src = src.replace(
19
+ /buildscript\s*\{\s*repositories\s*\{[\s\S]*?\}\s*([\r\n\t ]*dependencies\s*\{[\s\S]*?\}\s*)?\}/m,
20
+ (match) => ensureInsideFirstRepositoriesBlock(match)
21
+ );
22
+
23
+ // 2) allprojects.repositories
24
+ const replacedAll = src.replace(
25
+ /allprojects\s*\{\s*repositories\s*\{[\s\S]*?\}\s*\}/m,
26
+ (match) => ensureInsideFirstRepositoriesBlock(match)
27
+ );
28
+ if (replacedAll !== src) {
29
+ src = replacedAll;
30
+ } else if (!src.includes(REPO_MARKER)) {
31
+ // 3) append minimal block if none present
32
+ src += `
33
+
34
+ allprojects {
35
+ repositories {
36
+ google()
37
+ mavenCentral()
38
+ ${REPO_LINE}
39
+ }
40
+ }
41
+ `;
42
+ }
43
+
44
+ if (src === before) {
45
+ WarningAggregator.addWarningAndroid(
46
+ 'withHumanRepo',
47
+ 'No Gradle repositories block matched; appended minimal allprojects.repositories if repo not found.'
48
+ );
49
+ }
50
+
51
+ cfg.modResults.contents = src;
52
+ return cfg;
53
+ });
54
+ };
@@ -19,7 +19,7 @@ Pod::Spec.new do |s|
19
19
  s.static_framework = true
20
20
 
21
21
  s.dependency 'ExpoModulesCore'
22
- s.dependency 'HUMAN', '4.2.0'
22
+ s.dependency 'HUMAN', '4.2.1'
23
23
 
24
24
  # Swift/Objective-C compatibility
25
25
  s.pod_target_xcconfig = {
package/package.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
2
  "name": "@humansecurity/expo-mobile-sdk",
3
- "version": "1.0.6",
3
+ "version": "1.0.9",
4
+ "expo": {
5
+ "plugins": [
6
+ "./app.plugin.js"
7
+ ]
8
+ },
4
9
  "description": "An Expo module to wrap human native SDK for Expo users.",
5
10
  "main": "build/index.js",
6
11
  "types": "build/index.d.ts",
@@ -28,7 +33,7 @@
28
33
  "expo": "^53.0.0",
29
34
  "expo-modules-core": "^3.0.17",
30
35
  "expo-module-scripts": "^5.0.7",
31
- "react": "18.3.1",
36
+ "react": "19.1.0",
32
37
  "react-native": "0.81.4",
33
38
  "@types/react": "~19.1.0",
34
39
  "typescript": "^5.9.2"
Binary file
package/expo-module DELETED
File without changes
@@ -1,19 +0,0 @@
1
- export type HSPolicy = {
2
- hybridAppPolicy?: HSHybridAppPolicy;
3
- detectionPolicy?: HSDetectionPolicy;
4
- };
5
- export type HSHybridAppPolicy = {
6
- webRootDomains: {
7
- [key: string]: string[];
8
- };
9
- };
10
- export type HSDetectionPolicy = {
11
- allowTouchDetection: boolean;
12
- allowDeviceMotionDetection: boolean;
13
- };
14
- export declare enum HSBotDefenderChallengeResult {
15
- SOLVED = 0,// Native ordinal for solved
16
- CANCELLED = 1,// Native ordinal for cancelled
17
- FAILED = 2
18
- }
19
- //# sourceMappingURL=ExpoHumanSdk.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoHumanSdk.types.d.ts","sourceRoot":"","sources":["../src/ExpoHumanSdk.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,QAAQ,GAAG;IACrB,eAAe,CAAC,EAAE,iBAAiB,CAAC;IACpC,eAAe,CAAC,EAAE,iBAAiB,CAAC;CACrC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,cAAc,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CAC7C,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,0BAA0B,EAAE,OAAO,CAAC;CACrC,CAAC;AAEF,oBAAY,4BAA4B;IACtC,MAAM,IAAI,CAAE,4BAA4B;IACxC,SAAS,IAAI,CAAE,+BAA+B;IAC9C,MAAM,IAAI;CACX"}
@@ -1,7 +0,0 @@
1
- export var HSBotDefenderChallengeResult;
2
- (function (HSBotDefenderChallengeResult) {
3
- HSBotDefenderChallengeResult[HSBotDefenderChallengeResult["SOLVED"] = 0] = "SOLVED";
4
- HSBotDefenderChallengeResult[HSBotDefenderChallengeResult["CANCELLED"] = 1] = "CANCELLED";
5
- HSBotDefenderChallengeResult[HSBotDefenderChallengeResult["FAILED"] = 2] = "FAILED";
6
- })(HSBotDefenderChallengeResult || (HSBotDefenderChallengeResult = {}));
7
- //# sourceMappingURL=ExpoHumanSdk.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoHumanSdk.types.js","sourceRoot":"","sources":["../src/ExpoHumanSdk.types.ts"],"names":[],"mappings":"AAcA,MAAM,CAAN,IAAY,4BAIX;AAJD,WAAY,4BAA4B;IACtC,mFAAU,CAAA;IACV,yFAAa,CAAA;IACb,mFAAU,CAAA;AACZ,CAAC,EAJW,4BAA4B,KAA5B,4BAA4B,QAIvC","sourcesContent":["export type HSPolicy = {\n hybridAppPolicy?: HSHybridAppPolicy;\n detectionPolicy?: HSDetectionPolicy;\n};\n\nexport type HSHybridAppPolicy = {\n webRootDomains: { [key: string]: string[] };\n};\n\nexport type HSDetectionPolicy = {\n allowTouchDetection: boolean;\n allowDeviceMotionDetection: boolean;\n};\n\nexport enum HSBotDefenderChallengeResult {\n SOLVED = 0, // Native ordinal for solved\n CANCELLED = 1, // Native ordinal for cancelled\n FAILED = 2, // Indicates getting false from handle response - failed to handle the challenge.\n}\n"]}
@@ -1,25 +0,0 @@
1
- import { HSPolicy, HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
2
- declare class ExpoHumanSdkModule {
3
- sdkVersion(): string;
4
- startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;
5
- startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;
6
- vid(appId: string): string | null;
7
- headersForURLRequest(appId?: string): {
8
- [key: string]: string;
9
- };
10
- handleResponse(response: string, code: number, url: string): Promise<HSBotDefenderChallengeResult>;
11
- canHandleResponse(response: string, code: number, url: string): boolean;
12
- challengeReferenceId(): string;
13
- setCustomParameters(parameters: {
14
- [key: string]: string;
15
- }, appId?: string): void;
16
- setUserId(userId: string | null, appId?: string): void;
17
- registerOutgoingUrlRequest(url: string, appId?: string): void;
18
- setAdditionalData(parameters: {
19
- [key: string]: string;
20
- }, appId?: string): void;
21
- }
22
- export declare const addEventListener: (eventName: string, listener: (data: any) => void) => import("expo-modules-core").Subscription;
23
- declare const _default: ExpoHumanSdkModule;
24
- export default _default;
25
- //# sourceMappingURL=ExpoHumanSdkModule.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoHumanSdkModule.d.ts","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAI9E,OAAO,OAAO,kBAAkB;IAC9B,UAAU,IAAI,MAAM;IAEpB,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAC/D,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IACnE,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAGjC,oBAAoB,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE;IAC/D,cAAc,CACZ,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,4BAA4B,CAAC;IACxC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO;IACvE,oBAAoB,IAAI,MAAM;IAC9B,mBAAmB,CACjB,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACrC,KAAK,CAAC,EAAE,MAAM,GACb,IAAI;IAGP,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IACtD,0BAA0B,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAC7D,iBAAiB,CACf,UAAU,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,EACrC,KAAK,CAAC,EAAE,MAAM,GACb,IAAI;CACR;AAED,eAAO,MAAM,gBAAgB,GAC3B,WAAW,MAAM,EACjB,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,6CAG9B,CAAC;;AAGF,wBAAwE"}
@@ -1,8 +0,0 @@
1
- import { requireNativeModule, EventEmitter } from "expo-modules-core";
2
- const eventEmitter = new EventEmitter(requireNativeModule("HumanSecurity"));
3
- export const addEventListener = (eventName, listener) => {
4
- return eventEmitter.addListener(eventName, listener);
5
- };
6
- // This call loads the native module object from the JSI.
7
- export default requireNativeModule("HumanSecurity");
8
- //# sourceMappingURL=ExpoHumanSdkModule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ExpoHumanSdkModule.js","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAItE,MAAM,YAAY,GAAG,IAAI,YAAY,CAAC,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;AAgC5E,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,SAAiB,EACjB,QAA6B,EAC7B,EAAE;IACF,OAAO,YAAY,CAAC,WAAW,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;AACvD,CAAC,CAAC;AAEF,yDAAyD;AACzD,eAAe,mBAAmB,CAAqB,eAAe,CAAC,CAAC","sourcesContent":["import { requireNativeModule, EventEmitter } from \"expo-modules-core\";\n\nimport { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\n\nconst eventEmitter = new EventEmitter(requireNativeModule(\"HumanSecurity\"));\n\ndeclare class ExpoHumanSdkModule {\n sdkVersion(): string;\n\n startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;\n startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;\n vid(appId: string): string | null;\n\n // BD functionality\n headersForURLRequest(appId?: string): { [key: string]: string };\n handleResponse(\n response: string,\n code: number,\n url: string,\n ): Promise<HSBotDefenderChallengeResult>;\n canHandleResponse(response: string, code: number, url: string): boolean;\n challengeReferenceId(): string;\n setCustomParameters(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n\n // Adding AD functions\n setUserId(userId: string | null, appId?: string): void;\n registerOutgoingUrlRequest(url: string, appId?: string): void;\n setAdditionalData(\n parameters: { [key: string]: string },\n appId?: string,\n ): void;\n}\n\nexport const addEventListener = (\n eventName: string,\n listener: (data: any) => void,\n) => {\n return eventEmitter.addListener(eventName, listener);\n};\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoHumanSdkModule>(\"HumanSecurity\");\n"]}
@@ -1,37 +0,0 @@
1
- import { HSPolicy, HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
2
- declare const HS_EVENTS: {
3
- BOT_DEFENDER_REQUEST_BLOCKED: string;
4
- BOT_DEFENDER_CHALLENGE_SOLVED: string;
5
- BOT_DEFENDER_CHALLENGE_CANCELLED: string;
6
- BOT_DEFENDER_CHALLENGE_RENDERED: string;
7
- BOT_DEFENDER_CHALLENGE_RENDER_FAILED: string;
8
- BOT_DEFENDER_DID_UPDATE_HEADERS: string;
9
- };
10
- export declare class HumanSecurity {
11
- static sdkVersion(): string;
12
- static startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;
13
- static startWithAppIds(appIds: string[], policy?: HSPolicy): Promise<void>;
14
- static vid(appId: string): string | null;
15
- static BD: {
16
- headersForURLRequest(appId?: string): {
17
- [key: string]: string;
18
- };
19
- handleResponse(response: string, code: number, url: string): Promise<HSBotDefenderChallengeResult>;
20
- canHandleResponse(response: string, code: number, url: string): boolean;
21
- challengeReferenceId(): string;
22
- setCustomParameters(parameters: {
23
- [key: string]: string;
24
- }, appId?: string): void;
25
- addListener(eventName: string, callback: (data: any) => void): import("expo-modules-core").Subscription;
26
- };
27
- static AD: {
28
- setUserId(userId: string | null, appId?: string): void;
29
- registerOutgoingUrlRequest(url: string, appId?: string): void;
30
- setAdditionalData(parameters: {
31
- [key: string]: string;
32
- }, appId?: string): void;
33
- };
34
- }
35
- export { HS_EVENTS };
36
- export default HumanSecurity;
37
- //# sourceMappingURL=HumanSecurity.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HumanSecurity.d.ts","sourceRoot":"","sources":["../src/HumanSecurity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAG9E,QAAA,MAAM,SAAS;;;;;;;CAOd,CAAC;AAEF,qBAAa,aAAa;IACxB,MAAM,CAAC,UAAU,IAAI,MAAM;WAId,cAAc,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;WAI/D,eAAe,CAC1B,MAAM,EAAE,MAAM,EAAE,EAChB,MAAM,CAAC,EAAE,QAAQ,GAChB,OAAO,CAAC,IAAI,CAAC;IAIhB,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAIxC,MAAM,CAAC,EAAE;qCACsB,MAAM,GAAG;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE;iCAInD,MAAM,QACV,MAAM,OACP,MAAM,GACV,OAAO,CAAC,4BAA4B,CAAC;oCAWZ,MAAM,QAAQ,MAAM,OAAO,MAAM,GAAG,OAAO;gCAG/C,MAAM;wCAIhB;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,UAC7B,MAAM,GACb,IAAI;+BAGgB,MAAM,YAAY,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI;MAG5D;IAEF,MAAM,CAAC,EAAE;0BACW,MAAM,GAAG,IAAI,UAAU,MAAM,GAAG,IAAI;wCAGtB,MAAM,UAAU,MAAM,GAAG,IAAI;sCAI/C;YAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;SAAE,UAC7B,MAAM,GACb,IAAI;MAGP;CACH;AAED,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,eAAe,aAAa,CAAC"}
@@ -1,62 +0,0 @@
1
- import { HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
2
- import ExpoHumanSdkModule, { addEventListener } from "./ExpoHumanSdkModule";
3
- const HS_EVENTS = {
4
- BOT_DEFENDER_REQUEST_BLOCKED: "botDefenderRequestBlocked",
5
- BOT_DEFENDER_CHALLENGE_SOLVED: "botDefenderChallengeSolved",
6
- BOT_DEFENDER_CHALLENGE_CANCELLED: "botDefenderChallengeCancelled",
7
- BOT_DEFENDER_CHALLENGE_RENDERED: "botDefenderChallengeRendered",
8
- BOT_DEFENDER_CHALLENGE_RENDER_FAILED: "botDefenderChallengeRenderFailed",
9
- BOT_DEFENDER_DID_UPDATE_HEADERS: "botDefenderDidUpdateHeaders",
10
- };
11
- export class HumanSecurity {
12
- static sdkVersion() {
13
- return ExpoHumanSdkModule.sdkVersion();
14
- }
15
- static async startWithAppId(appId, policy) {
16
- return await ExpoHumanSdkModule.startWithAppId(appId, policy);
17
- }
18
- static async startWithAppIds(appIds, policy) {
19
- return await ExpoHumanSdkModule.startWithAppIds(appIds, policy);
20
- }
21
- static vid(appId) {
22
- return ExpoHumanSdkModule.vid(appId);
23
- }
24
- static BD = {
25
- headersForURLRequest(appId) {
26
- return ExpoHumanSdkModule.headersForURLRequest(appId);
27
- },
28
- async handleResponse(response, code, url) {
29
- const resultOrdinal = await ExpoHumanSdkModule.handleResponse(response, code, url);
30
- if (resultOrdinal in HSBotDefenderChallengeResult) {
31
- return resultOrdinal;
32
- }
33
- return HSBotDefenderChallengeResult.FAILED;
34
- },
35
- canHandleResponse(response, code, url) {
36
- return ExpoHumanSdkModule.canHandleResponse(response, code, url);
37
- },
38
- challengeReferenceId() {
39
- return ExpoHumanSdkModule.challengeReferenceId();
40
- },
41
- setCustomParameters(parameters, appId) {
42
- ExpoHumanSdkModule.setCustomParameters(parameters, appId);
43
- },
44
- addListener(eventName, callback) {
45
- return addEventListener(eventName, callback);
46
- },
47
- };
48
- static AD = {
49
- setUserId(userId, appId) {
50
- ExpoHumanSdkModule.setUserId(userId, appId);
51
- },
52
- registerOutgoingUrlRequest(url, appId) {
53
- ExpoHumanSdkModule.registerOutgoingUrlRequest(url, appId);
54
- },
55
- setAdditionalData(parameters, appId) {
56
- ExpoHumanSdkModule.setAdditionalData(parameters, appId);
57
- },
58
- };
59
- }
60
- export { HS_EVENTS };
61
- export default HumanSecurity;
62
- //# sourceMappingURL=HumanSecurity.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"HumanSecurity.js","sourceRoot":"","sources":["../src/HumanSecurity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAY,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAC9E,OAAO,kBAAkB,EAAE,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE5E,MAAM,SAAS,GAAG;IAChB,4BAA4B,EAAE,2BAA2B;IACzD,6BAA6B,EAAE,4BAA4B;IAC3D,gCAAgC,EAAE,+BAA+B;IACjE,+BAA+B,EAAE,8BAA8B;IAC/D,oCAAoC,EAAE,kCAAkC;IACxE,+BAA+B,EAAE,6BAA6B;CAC/D,CAAC;AAEF,MAAM,OAAO,aAAa;IACxB,MAAM,CAAC,UAAU;QACf,OAAO,kBAAkB,CAAC,UAAU,EAAE,CAAC;IACzC,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,KAAa,EAAE,MAAiB;QAC1D,OAAO,MAAM,kBAAkB,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAChE,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,eAAe,CAC1B,MAAgB,EAChB,MAAiB;QAEjB,OAAO,MAAM,kBAAkB,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,KAAa;QACtB,OAAO,kBAAkB,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;IAED,MAAM,CAAC,EAAE,GAAG;QACV,oBAAoB,CAAC,KAAc;YACjC,OAAO,kBAAkB,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACxD,CAAC;QACD,KAAK,CAAC,cAAc,CAClB,QAAgB,EAChB,IAAY,EACZ,GAAW;YAEX,MAAM,aAAa,GAAG,MAAM,kBAAkB,CAAC,cAAc,CAC3D,QAAQ,EACR,IAAI,EACJ,GAAG,CACJ,CAAC;YACF,IAAI,aAAa,IAAI,4BAA4B,EAAE,CAAC;gBAClD,OAAO,aAA6C,CAAC;YACvD,CAAC;YACD,OAAO,4BAA4B,CAAC,MAAM,CAAC;QAC7C,CAAC;QACD,iBAAiB,CAAC,QAAgB,EAAE,IAAY,EAAE,GAAW;YAC3D,OAAO,kBAAkB,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,EAAE,GAAG,CAAC,CAAC;QACnE,CAAC;QACD,oBAAoB;YAClB,OAAO,kBAAkB,CAAC,oBAAoB,EAAE,CAAC;QACnD,CAAC;QACD,mBAAmB,CACjB,UAAqC,EACrC,KAAc;YAEd,kBAAkB,CAAC,mBAAmB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC5D,CAAC;QACD,WAAW,CAAC,SAAiB,EAAE,QAA6B;YAC1D,OAAO,gBAAgB,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;QAC/C,CAAC;KACF,CAAC;IAEF,MAAM,CAAC,EAAE,GAAG;QACV,SAAS,CAAC,MAAqB,EAAE,KAAc;YAC7C,kBAAkB,CAAC,SAAS,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QAC9C,CAAC;QACD,0BAA0B,CAAC,GAAW,EAAE,KAAc;YACpD,kBAAkB,CAAC,0BAA0B,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;QAC5D,CAAC;QACD,iBAAiB,CACf,UAAqC,EACrC,KAAc;YAEd,kBAAkB,CAAC,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;QAC1D,CAAC;KACF,CAAC;;AAGJ,OAAO,EAAE,SAAS,EAAE,CAAC;AACrB,eAAe,aAAa,CAAC","sourcesContent":["import { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\nimport ExpoHumanSdkModule, { addEventListener } from \"./ExpoHumanSdkModule\";\n\nconst HS_EVENTS = {\n BOT_DEFENDER_REQUEST_BLOCKED: \"botDefenderRequestBlocked\",\n BOT_DEFENDER_CHALLENGE_SOLVED: \"botDefenderChallengeSolved\",\n BOT_DEFENDER_CHALLENGE_CANCELLED: \"botDefenderChallengeCancelled\",\n BOT_DEFENDER_CHALLENGE_RENDERED: \"botDefenderChallengeRendered\",\n BOT_DEFENDER_CHALLENGE_RENDER_FAILED: \"botDefenderChallengeRenderFailed\",\n BOT_DEFENDER_DID_UPDATE_HEADERS: \"botDefenderDidUpdateHeaders\",\n};\n\nexport class HumanSecurity {\n static sdkVersion(): string {\n return ExpoHumanSdkModule.sdkVersion();\n }\n\n static async startWithAppId(appId: string, policy?: HSPolicy): Promise<void> {\n return await ExpoHumanSdkModule.startWithAppId(appId, policy);\n }\n\n static async startWithAppIds(\n appIds: string[],\n policy?: HSPolicy,\n ): Promise<void> {\n return await ExpoHumanSdkModule.startWithAppIds(appIds, policy);\n }\n\n static vid(appId: string): string | null {\n return ExpoHumanSdkModule.vid(appId);\n }\n\n static BD = {\n headersForURLRequest(appId?: string): { [key: string]: string } {\n return ExpoHumanSdkModule.headersForURLRequest(appId);\n },\n async handleResponse(\n response: string,\n code: number,\n url: string,\n ): Promise<HSBotDefenderChallengeResult> {\n const resultOrdinal = await ExpoHumanSdkModule.handleResponse(\n response,\n code,\n url,\n );\n if (resultOrdinal in HSBotDefenderChallengeResult) {\n return resultOrdinal as HSBotDefenderChallengeResult;\n }\n return HSBotDefenderChallengeResult.FAILED;\n },\n canHandleResponse(response: string, code: number, url: string): boolean {\n return ExpoHumanSdkModule.canHandleResponse(response, code, url);\n },\n challengeReferenceId(): string {\n return ExpoHumanSdkModule.challengeReferenceId();\n },\n setCustomParameters(\n parameters: { [key: string]: string },\n appId?: string,\n ): void {\n ExpoHumanSdkModule.setCustomParameters(parameters, appId);\n },\n addListener(eventName: string, callback: (data: any) => void) {\n return addEventListener(eventName, callback);\n },\n };\n\n static AD = {\n setUserId(userId: string | null, appId?: string): void {\n ExpoHumanSdkModule.setUserId(userId, appId);\n },\n registerOutgoingUrlRequest(url: string, appId?: string): void {\n ExpoHumanSdkModule.registerOutgoingUrlRequest(url, appId);\n },\n setAdditionalData(\n parameters: { [key: string]: string },\n appId?: string,\n ): void {\n ExpoHumanSdkModule.setAdditionalData(parameters, appId);\n },\n };\n}\n\nexport { HS_EVENTS };\nexport default HumanSecurity;\n"]}
@@ -1,3 +0,0 @@
1
- export { default as HumanSecurity, HS_EVENTS } from "./HumanSecurity";
2
- export { HSPolicy, HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC"}
@@ -1,3 +0,0 @@
1
- export { default as HumanSecurity, HS_EVENTS } from "./HumanSecurity";
2
- export { HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAY,4BAA4B,EAAE,MAAM,sBAAsB,CAAC","sourcesContent":["export { default as HumanSecurity, HS_EVENTS } from \"./HumanSecurity\";\nexport { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\n"]}