Errors, security and troubleshooting
Handle typed failures without leaking credentials or weakening authorization.
Handle typed authentication errors
Use AuthClientError.code and statusCode. Do not log raw HumanAuthHttpError.response. retryable does not mean financial mutations are safe to replay.
import { AuthClientError } from "@lambabros/mobile-auth-sdk";
try {
await auth.login(identifier, password);
} catch (error) {
if (error instanceof AuthClientError) {
// Map error.code to a safe user-facing message.
// Respect error.retryAfterSeconds when supplied.
} else {
// Generic failure; never expose raw secrets or response bodies.
}
}Error-to-action mapping
AUTH_INVALID_CREDENTIALS: correct login input. AUTH_CHALLENGE_INVALID: request fresh proof. AUTH_MFA_LOGIN_CHALLENGE_INVALID: explicit retry until challenge expires, then restart login. AUTH_PIN_INVALID: show PIN error. AUTH_STEP_UP_REQUIRED: show MFA step-up. AUTH_TRANSACTION_AUTHORIZATION_REQUIRED: obtain service-owned challenge. AUTH_PERMISSION_DENIED: do not retry as authentication. AUTH_SESSION_INACTIVE: reconcile session and route to login if cleared. AUTH_UPSTREAM_RATE_LIMITED: respect retry delay. SDK_SESSION_CHANGED: discard old client and results.
Expo upgrade troubleshooting
Use the Node range reported by installed Expo packages (the supplied SDK 58 logs accept Node 22.13+ within 22.x). Align with npx expo install --fix and run expo-doctor. Avoid forced npm peer resolution and npm audit fix --force. Generated route types may require restarting Expo after route changes. Existing application TypeScript errors are not resolved by these docs.
node -v
npx expo install --check
npx expo-doctor@latest
npm --prefix packages/lbt-wallet-sdk run build
npx expo start --clear --goNon-negotiable security boundaries
No machine secrets in EXPO_PUBLIC variables. No authentication tokens in AsyncStorage or Redux. No automatic mutation replay. Never log passwords, PINs, OTPs, provider proofs, backup passphrases, mnemonics or signing payload secrets. Do not treat local biometric, PIN or recent MFA as transaction-specific authorization. Verify deployment URLs and chain contracts; use test wallets until release gates are closed.