Skip to main content
The JavaScript SDK uses ShieldLabsError for validation, loading and identification failures. Branch on code; use message for diagnostics.

Error fields

string
required
Always ShieldLabsError.
ShieldLabsErrorCode
required
One of the five values below.
string
required
A human-readable explanation. Do not use its wording as an application contract.
unknown
The underlying error when available, such as a failed module import.

Error codes

load(), identify() and check() report failures through rejected promises. identifyOnInteraction() validates arguments synchronously. Its take() method returns a promise. check() converts not_initialized into null. This includes cooldown skips; null is not a risk result.

Separate browser errors from API errors

A browser timeout does not identify an HTTP status or prove that no check was accepted. Server API failures have their own HTTP status codes. Verify the server result before completing a protected action.