Skip to main content
Every SDK error is an instance of AbadgeApiError. The class carries the same envelope as the underlying API response.

Shape

For VALIDATION_ERROR, per-field issues are exposed as a top-level issues array of { path, message } objects.

Basic usage

Common codes

See the full code list in Errors.

Recovering from multi-field errors

Recovering from session refresh failures

SESSION_REFRESH_FAILED means the background refresher couldn’t mint a new abs_... token after bounded backoff retries. Reconnect:

Validation errors

VALIDATION_ERROR carries the failing inputs in the top-level issues array:

SecretValue opaque type

The SDK exports a SecretValue wrapper class to discourage accidental logging or serialization of secret data. Its toJSON(), toString(), and util.inspect hooks all render [REDACTED]; the underlying string is only reachable via an explicit .expose() call. access.read returns the decrypted payload directly (result.payload.fields), not a SecretValue. Wrap the field yourself when you want the redaction guarantees as a value flows through your own code:
Never log a raw SecretValue — only call .expose() at the point of use.

Retry strategy