The uniform result shape every asynchronous method on
FaableAuthClient resolves to.
The whole client follows one error contract: methods never throw for
expected failures — they resolve with the error in error. On success
error is null and data holds the payload; on failure data is null
and error is an AuthError. Always check error before reading
data. The only thing that throws is createClient itself (missing
domain/clientId — a programming error, not a runtime one).
If you prefer throw-style control flow, wrap a call in unwrap instead
of hand-writing if (error) throw error.
AuthResponse and OAuthResponse are the two richer, discriminated variants
of this same contract.
The uniform result shape every asynchronous method on FaableAuthClient resolves to.
The whole client follows one error contract: methods never throw for expected failures — they resolve with the error in
error. On successerrorisnullanddataholds the payload; on failuredataisnullanderroris an AuthError. Always checkerrorbefore readingdata. The only thing that throws iscreateClientitself (missingdomain/clientId— a programming error, not a runtime one).If you prefer throw-style control flow, wrap a call in unwrap instead of hand-writing
if (error) throw error.AuthResponseandOAuthResponseare the two richer, discriminated variants of this same contract.