Saltar al contenido principal
Version: Guardian v0.3.1

Error Codes

SDK Errors (SurtError)

ErrorWhen
notInitializedverify() called before initialize()
invalidJwtJWT missing, malformed, or rejected by the backend. Mint a fresh JWT per verify().
networkErrorTimeout or no connection
serverError5xx from backend
attestationFailedPlatform attestation failed

Native platforms surface these as .notInitialized / .invalidJwt / etc. The React Native bridge surfaces string codes: not_initialized, invalid_jwt, attestation_failed, network_error.

Web SDK errors

The Web SDK (@surtai/guardian-web) uses a separate GuardianError with the codes CRYPTO_UNAVAILABLE, ENCRYPTION_FAILED, and INVALID_OPTIONS. See NPM Package.

HTTP Status Codes

CodeMeaning
200Success
400Malformed JSON or missing required field
401Invalid or missing Bearer JWT
403Valid key but missing permission
5xxServer error