Skip to main content
Failed JSON requests return a stable code and human-readable message:
Branch on error.code, not the message text.

Common codes

Provider-management operations also return specific configuration, registration, disabled-provider, in-use, and organization-mismatch codes.

OAuth callback errors

When returnTo or return_to is configured, failed callbacks redirect with:
Do not display the code as the only explanation to an end user. Map expected codes to application-specific recovery actions and keep diagnostic detail in server logs.

Typed client errors

@hookfish/sdk throws HookfishError. Check its status for HTTP behavior and its code for the stable Hookfish error code. The original error object remains available as body. Translate the failure into an application-level response; do not forward provider details or credentials to the browser.
@hookfish/hooks, when used with the optional browser facade, throws HookfishApiError from its queries and mutations.