HCaptchaConfig

data class HCaptchaConfig(val siteKey: String, val sentry: Boolean = true, val loading: Boolean = true, val hideDialog: Boolean = false, val rqdata: String? = null, val jsSrc: String = "https://js.hcaptcha.com/1/api.js", val endpoint: String? = null, val reportapi: String? = null, val assethost: String? = null, val imghost: String? = null, val locale: String = Locale.getDefault().language, val size: HCaptchaSize = HCaptchaSize.INVISIBLE, val orientation: HCaptchaOrientation = HCaptchaOrientation.PORTRAIT, val theme: HCaptchaTheme = HCaptchaTheme.LIGHT, val host: String? = null, val customTheme: String? = null, val retryPredicate: (HCaptchaConfig, HCaptchaException) -> Boolean? = null, val tokenExpiration: Duration = 120.seconds, val disableHardwareAcceleration: Boolean = true) : Serializable

hCaptcha config builder which allows further customization of UI and other logic. .siteKey is the only mandatory property.

Constructors

Link copied to clipboard
constructor(siteKey: String, sentry: Boolean = true, loading: Boolean = true, hideDialog: Boolean = false, rqdata: String? = null, jsSrc: String = "https://js.hcaptcha.com/1/api.js", endpoint: String? = null, reportapi: String? = null, assethost: String? = null, imghost: String? = null, locale: String = Locale.getDefault().language, size: HCaptchaSize = HCaptchaSize.INVISIBLE, orientation: HCaptchaOrientation = HCaptchaOrientation.PORTRAIT, theme: HCaptchaTheme = HCaptchaTheme.LIGHT, host: String? = null, customTheme: String? = null, retryPredicate: (HCaptchaConfig, HCaptchaException) -> Boolean? = null, tokenExpiration: Duration = 120.seconds, disableHardwareAcceleration: Boolean = true)

Types

Link copied to clipboard

Properties

Link copied to clipboard
val assethost: String? = null

Points loaded hCaptcha assets to a user defined asset location, used for proxies. Default: https://newassets.hcaptcha.com (Override only if using first-party hosting feature.)

Link copied to clipboard
val customTheme: String? = null

Custom theme JSON string

Link copied to clipboard

Disable hardware acceleration for WebView

Link copied to clipboard
val endpoint: String? = null

Point hCaptcha JS Ajax Requests to alternative API Endpoint. Default: https://api.hcaptcha.com (Override only if using first-party hosting feature.)

Link copied to clipboard
val hideDialog: Boolean = false

Can be used in combination with passive sitekey to achieve full invisible flow. See enterprise docs for more information.

Link copied to clipboard
val host: String? = null

hCaptcha SDK host identifier. null value means that it will be generated by SDK

Link copied to clipboard
val imghost: String? = null

Points loaded hCaptcha challenge images to a user defined image location, used for proxies. Default: https://imgs.hcaptcha.com (Override only if using first-party hosting feature.)

Link copied to clipboard

The url of api.js Default: https://js.hcaptcha.com/1/api.js (Override only if using first-party hosting feature.)

Link copied to clipboard
val loading: Boolean = true

Show / Hide loading dialog.

Link copied to clipboard

The locale: 2 characters language code iso 639-1 Default: current default locale for this instance of the JVM.

Link copied to clipboard

The orientation of the challenge. Default is HCaptchaOrientation.PORTRAIT.

Link copied to clipboard
val reportapi: String? = null

Point hCaptcha Bug Reporting Request to alternative API Endpoint. Default: https://accounts.hcaptcha.com (Override only if using first-party hosting feature.)

Link copied to clipboard

The lambda will decide should we retry or not

Link copied to clipboard
val rqdata: String? = null

Custom supplied challenge data.

Link copied to clipboard
val sentry: Boolean = true

Enable / Disable sentry error reporting.

Link copied to clipboard

The site key. Get one here hcaptcha.com

Link copied to clipboard

The size of the checkbox. Default is HCaptchaSize.INVISIBLE.

Link copied to clipboard

The theme. Default is HCaptchaTheme.LIGHT.

Link copied to clipboard

hCaptcha token expiration timeout (seconds)