Callbacks

This table lists all the Client API callbacks, when each can be triggered, and which Arkose components each is relevant for (i.e. onShow is only triggered when an Enforcement Challenge is shown. Since our detection component does not have Enforcement Challenges, you only have to define a callback for onShow when using our enforcement component).

For how to associate a function definition with a callback, see Configuration Object.

Callback NameWhen TriggeredApplicable Component
onReady

When API is loaded and configured OR

When a challenge is programmatically reset after onReset triggers.

Detection
Enforcement
onErrorAt any point in a session when an internal Arkose API error occurs.Detection
Enforcement
onWarningAt any point in a session when an internal Arkose API warning is triggered.Detection
Enforcement
onShow

When a selector is pressed, but before a challenge is shown AND

When a challenge is closed but is then shown again.

Enforcement
onSuppressWhen a session is classified as not needing a challenge.Detection
Enforcement
onShown

When a challenge is initially shown AND

When a challenge is closed and then shown again.

Enforcement
onCompleted

When no challenge is needed OR

When a challenge is answered correctly.

Detection
Enforcement
onHide

When a challenge is closed using ESC or its X button OR

After onCompleted triggers OR

After onError triggers in Client API version earlier than 3.0.0 when session setup fails, whether a challenge was shown or not.

Detection (second and third situations only)

Enforcement (first, second and third situations)

onFailedWhen a challenge cannot proceed due to exhausted configuration thresholds. This occurs when retry attempts are exceeded (defaults to unlimited) or PoW action is block.Enforcement
onReset

When a challenge is programmatically reset OR

When a challenge is answered correctly.

Enforcement
onResize

When a challenge is shown AND

After onShown triggers.

Enforcement