Error Codes
SDK Errors (SurtError)
| Error | When |
|---|---|
notInitialized | verify() called before initialize() |
invalidJwt | JWT missing, malformed, or rejected by the backend. Mint a fresh JWT per verify(). |
networkError | Timeout or no connection |
serverError | 5xx from backend |
attestationFailed | Platform 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
| Code | Meaning |
|---|---|
200 | Success |
400 | Malformed JSON or missing required field |
401 | Invalid or missing Bearer JWT |
403 | Valid key but missing permission |
5xx | Server error |