- Typed error translation without casts.
translateError(t)in@fofo/errorsbinds any typed i18nexttcoveringErrorMessageKey | AuthErrorMessageKeyinto(error: unknown) => string. Fourteen inline(key, params) => t(key as never, params ?? {})adapters across web and mobile are replaced. - One retry policy; mobile stops retrying 4xx.
retryQuerymoved to the leaf@fofo/errors/query-retryand is used by both apps. Mobile stops retrying 4xx responses and keeps its single retry for 5xx and network failures (maxRetries: 1; web retries twice). A Better Auth client error with a 4xx status counts as a 4xx on both, so web no longer retries it. Web passes{ isServer: typeof document === "undefined" }so SSR never blocks on backoff. - One mutation-toast rule, user-agent parser and admin role check.
shouldToastMutationErrorlives in@fofo/errors/mutation-toast,parseUserAgentin@fofo/auth/user-agent(bringing native iOS/Android and iPadOS desktop-mode recognition to web session and activity views as well), andsessionHasAdminRolein@fofo/api/admin/rolesusing the stricterADMIN_ROLESfail-closed check on both server and client. - A test prevents future drift.
scripts/duplicate-platform-exports.test.mjsfails when the same exported function name exists in bothapps/web/src/platformandapps/mobile/src/platform, with a hook allowlist that fails when stale. See Conventions and Enforcement.
Shared client policy across web and mobile
Error translation, mutation toasts, query retries, user-agent parsing and platform-admin role checks now live once in client-safe leaf modules, and a test prevents new platform duplicates.
Edit on GitHubDocumentation is in English.