Changes from v3
SDK name change
-
The SDK name has been changed from PerimeterX to HUMAN.
- Android:
import com.humansecurity.mobile_sdk.HumanSecurity - iOS:
import HUMAN
- Android:
-
Repository Update for Android: Update your
build.gradlefile to use the new SDK repository location: -
Class Renaming: The main class has been renamed from
PerimeterXtoHumanSecurity. All SDK classes now have theHSprefix instead ofPX. -
Function Relocation: Some functions previously in
PerimeterXhave been moved toHSBotDefenderandHSAccountDefenderclasses based on their context. -
Delegate Renaming:
PerimeterXDelegatehas been renamed toHSBotDefenderDelegate. -
Error Handling: Error query functions have been consolidated into the
HSBotDefender/errorType(error:)function. -
Removal of
HSTimeoutInterceptor(Android):- The
HSTimeoutInterceptorclass has been removed. - You can now set different timeouts directly in the OkHttp client configuration.
- The
Policy object changes
- The policy object has been restructured from a single-level object to nested objects for different policy types:
HSAutomaticInterceptorPolicy: Configurations for “Automatic Interceptor”HSHybridAppPolicy: Configurations for “Hybrid App”HSDetectionPolicy: Configurations related to the SDK’s detection mechanismsHSDoctorAppPolicy: Configurations for the “Doctor App”
Bot Defender
- The
HSBotDefender/headersForURLRequest(forAppId:)function previously returnednilornullif called beforeHumanSecurity/start(appId:policy:). It has now been updated to always return a value (never empty). However, it must be called afterHumanSecurity/start(appId:policy:).
Hybrid App
- To enable “Hybrid App,” call the
HSHybridAppPolicy/set(webRootDomains:forAppId:)function. SetwebRootDomainsto the bare registrable root (example.com). A leading dot is accepted and equivalent. Do not list a subdomain. See Hybrid App integration for more information.
New in iOS
- The
HumanSecurity/setupWebView(webView:navigationDelegate:)function allows for manual “Hybrid App” integration, unlike the automatic method available in previous versions. - The
HSHybridAppPolicy/automaticSetupoption enables the same automatic “Hybrid App” integration that was available in previous versions.
Environment
Android
-
SDK Build Specifications:
- The SDK is now built for API 35 and Kotlin 2.1.0.
-
New Dependencies:
- The SDK has a new list of dependencies (see below). When fetching the SDK from our Artifactory, these dependencies are automatically included.
If you need to change the version of some dependencies, you may integrate the SDK manually and select the exact versions that work for your app.