Skip to main content
useErrors(options?: UseErrorOptions)
React hook for reading and managing errors in ACUL (Advanced Customization of Universal Login). It groups errors into three kinds:
  • auth0 — errors returned by Auth0 or your own backend.
  • validation — errors from client-side validation (e.g., invalid form input).
  • configuration — errors caused by incorrect integration or SDK misuse.

Key Features

  • Unified error store — surfaces auth0, validation, and configuration errors from a single hook.
  • Flexible filtering — query errors by kind, field, or a combination of both.
  • Dismiss controls — remove individual errors or clear all at once.

Parameters

Optional configuration for the hook.

Returns

UseErrorsResultA UseErrorsResult object containing:
  • errors — the full error list of type ErrorsResult, with helpers:
    • errors.byType(type, filter?) — filter by error type and optionally by field.
    • errors.byField(field, filter?) — filter by field and optionally by type.
  • hasErrortrue if any error is currently present.
  • dismiss(id) — remove a specific error by its ID.
  • dismissAll() — clear all tracked errors.

Supported Screens

  • The useErrors hook is available on every ACUL screen.
Example
In addition to rendering messages, you can filter by field or kind:

Remarks

  • useErrors is not screen-scoped — import it directly from @auth0/auth0-acul-react.
  • Call useErrors at the top level of your component; do not call it conditionally or inside event handlers.
  • Use includeDevErrors: true during development to surface SDK misuse errors; disable it in production.