@humansecurity/expo-mobile-sdk 1.0.4 → 1.0.6
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 +16 -0
- package/android/build.gradle +10 -10
- package/android/libs/HUMAN-4.2.1.aar +0 -0
- package/build/ExpoHumanSdkModule.d.ts +4 -1
- package/build/ExpoHumanSdkModule.d.ts.map +1 -1
- package/build/ExpoHumanSdkModule.js.map +1 -1
- package/build/HumanSecurity.d.ts +1 -1
- package/expo-module +0 -0
- package/ios/HumanSecurity.podspec +1 -1
- package/package/build/ExpoHumanSdk.types.d.ts +19 -0
- package/package/build/ExpoHumanSdk.types.d.ts.map +1 -0
- package/package/build/ExpoHumanSdk.types.js +7 -0
- package/package/build/ExpoHumanSdk.types.js.map +1 -0
- package/package/build/ExpoHumanSdkModule.d.ts +25 -0
- package/package/build/ExpoHumanSdkModule.d.ts.map +1 -0
- package/package/build/ExpoHumanSdkModule.js +8 -0
- package/package/build/ExpoHumanSdkModule.js.map +1 -0
- package/package/build/HumanSecurity.d.ts +37 -0
- package/package/build/HumanSecurity.d.ts.map +1 -0
- package/package/build/HumanSecurity.js +62 -0
- package/package/build/HumanSecurity.js.map +1 -0
- package/package/build/index.d.ts +3 -0
- package/package/build/index.d.ts.map +1 -0
- package/package/build/index.js +3 -0
- package/package/build/index.js.map +1 -0
- package/package.json +13 -10
- package/android/libs/HUMAN-4.0.3.aar +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
For Expo wrapper versions
|
|
3
|
+
|
|
4
|
+
## [1.0.5] - 09-09-2025
|
|
5
|
+
### Updated wrapper version to Expo 53 and native sdk version 4.2.0 to include new human_session.
|
|
6
|
+
- Expo version: "^53.0.0"
|
|
7
|
+
- react-native: "0.76.9" - "react": "^18.2.0"
|
|
8
|
+
- iOS SDK version: 4.2.0
|
|
9
|
+
- Android SDK version: 4.2.0 - copmiled speacially with kotlin 1.9.25
|
|
10
|
+
|
|
11
|
+
## [1.0.4] - 09-02-2025
|
|
12
|
+
### Released wrapper to support easy Expo integration.
|
|
13
|
+
- Expo version: "~51.0.37" - devDependencies - dependencies - "^53.0.0"
|
|
14
|
+
- react-native: "0.74.5" - devDependencies
|
|
15
|
+
- iOS SDK version: 4.0.3
|
|
16
|
+
- Android SDK version: 4.1.0
|
package/android/build.gradle
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
apply plugin: 'com.android.library'
|
|
2
2
|
|
|
3
3
|
group = 'expo.modules.humansdk'
|
|
4
|
-
version = '1.0.
|
|
4
|
+
version = '1.0.5'
|
|
5
5
|
|
|
6
6
|
def expoModulesCorePlugin = new File(project(":expo-modules-core").projectDir.absolutePath, "ExpoModulesCorePlugin.gradle")
|
|
7
7
|
apply from: expoModulesCorePlugin
|
|
@@ -32,20 +32,20 @@ if (useManagedAndroidSdkVersions) {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
dependencies {
|
|
35
|
-
implementation files('libs/HUMAN-4.
|
|
36
|
-
implementation
|
|
37
|
-
implementation
|
|
38
|
-
implementation
|
|
39
|
-
implementation
|
|
40
|
-
implementation
|
|
41
|
-
implementation
|
|
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
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
android {
|
|
45
45
|
namespace "expo.modules.humansdk"
|
|
46
46
|
defaultConfig {
|
|
47
|
-
versionCode
|
|
48
|
-
versionName "1.0.
|
|
47
|
+
versionCode 6
|
|
48
|
+
versionName "1.0.6"
|
|
49
49
|
}
|
|
50
50
|
lintOptions {
|
|
51
51
|
abortOnError false
|
|
Binary file
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { HSPolicy, HSBotDefenderChallengeResult } from "./ExpoHumanSdk.types";
|
|
2
|
+
export type Subscription = {
|
|
3
|
+
remove: () => void;
|
|
4
|
+
};
|
|
2
5
|
declare class ExpoHumanSdkModule {
|
|
3
6
|
sdkVersion(): string;
|
|
4
7
|
startWithAppId(appId: string, policy?: HSPolicy): Promise<void>;
|
|
@@ -19,7 +22,7 @@ declare class ExpoHumanSdkModule {
|
|
|
19
22
|
[key: string]: string;
|
|
20
23
|
}, appId?: string): void;
|
|
21
24
|
}
|
|
22
|
-
export declare const addEventListener: (eventName: string, listener: (data: any) => void) =>
|
|
25
|
+
export declare const addEventListener: (eventName: string, listener: (data: any) => void) => Subscription;
|
|
23
26
|
declare const _default: ExpoHumanSdkModule;
|
|
24
27
|
export default _default;
|
|
25
28
|
//# sourceMappingURL=ExpoHumanSdkModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoHumanSdkModule.d.ts","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ExpoHumanSdkModule.d.ts","sourceRoot":"","sources":["../src/ExpoHumanSdkModule.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AAK9E,MAAM,MAAM,YAAY,GAAG;IAAE,MAAM,EAAE,MAAM,IAAI,CAAA;CAAE,CAAC;AAElD,OAAO,OAAO,kBAAkB;IAC9B,UAAU,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"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,
|
|
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,CAAW,mBAAmB,CAAC,eAAe,CAAC,CAAC,CAAC;AAkCtF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,SAAiB,EACjB,QAA6B,EACf,EAAE;IAChB,OAAO,YAAY,CAAC,WAAW,CAAC,SAA2B,EAAE,QAAQ,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,yDAAyD;AACzD,eAAe,mBAAmB,CAAqB,eAAe,CAAC,CAAC","sourcesContent":["import { requireNativeModule, EventEmitter } from \"expo-modules-core\";\nimport { HSPolicy, HSBotDefenderChallengeResult } from \"./ExpoHumanSdk.types\";\n\ntype EventMap = Record<string, (data: any) => void>;\nconst eventEmitter = new EventEmitter<EventMap>(requireNativeModule(\"HumanSecurity\"));\n\nexport type Subscription = { remove: () => void };\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): Subscription => {\n return eventEmitter.addListener(eventName as keyof EventMap, listener);\n};\n\n// This call loads the native module object from the JSI.\nexport default requireNativeModule<ExpoHumanSdkModule>(\"HumanSecurity\");\n"]}
|
package/build/HumanSecurity.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare class HumanSecurity {
|
|
|
22
22
|
setCustomParameters(parameters: {
|
|
23
23
|
[key: string]: string;
|
|
24
24
|
}, appId?: string): void;
|
|
25
|
-
addListener(eventName: string, callback: (data: any) => void): import("
|
|
25
|
+
addListener(eventName: string, callback: (data: any) => void): import("./ExpoHumanSdkModule").Subscription;
|
|
26
26
|
};
|
|
27
27
|
static AD: {
|
|
28
28
|
setUserId(userId: string | null, appId?: string): void;
|
package/expo-module
ADDED
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|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C,EAAE,MAAM,GACb,IAAI;CACR;AAED,eAAO,MAAM,gBAAgB,GAC3B,WAAW,MAAM,EACjB,UAAU,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,6CAG9B,CAAC;;AAGF,wBAAwE"}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,62 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@humansecurity/expo-mobile-sdk",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "An Expo module to wrap human native SDK for
|
|
3
|
+
"version": "1.0.6",
|
|
4
|
+
"description": "An Expo module to wrap human native SDK for Expo users.",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
@@ -24,16 +24,19 @@
|
|
|
24
24
|
"author": "",
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"homepage": "https://github.com/PerimeterX/human-security-ios-sdk#readme",
|
|
27
|
-
"dependencies": {},
|
|
28
27
|
"devDependencies": {
|
|
29
|
-
"
|
|
30
|
-
"expo-
|
|
31
|
-
"expo": "
|
|
32
|
-
"react
|
|
28
|
+
"expo": "^53.0.0",
|
|
29
|
+
"expo-modules-core": "^3.0.17",
|
|
30
|
+
"expo-module-scripts": "^5.0.7",
|
|
31
|
+
"react": "18.3.1",
|
|
32
|
+
"react-native": "0.81.4",
|
|
33
|
+
"@types/react": "~19.1.0",
|
|
34
|
+
"typescript": "^5.9.2"
|
|
33
35
|
},
|
|
34
36
|
"peerDependencies": {
|
|
35
|
-
"expo": "
|
|
36
|
-
"
|
|
37
|
-
"react
|
|
37
|
+
"expo": "^53 || ^54",
|
|
38
|
+
"expo-modules-core": "^3.0.0",
|
|
39
|
+
"react": ">=18",
|
|
40
|
+
"react-native": ">=0.76"
|
|
38
41
|
}
|
|
39
42
|
}
|
|
Binary file
|