The shared React toolkit behind the Vectros reference apps — admin-app (control plane) and app.vectros.ai (data plane). It packages the parts both apps need to look and behave the same without copy-paste:
- Provider-agnostic auth — an
AuthProviderAdapterinterface plus aCognitoAuthProviderreference implementation (sign-in/up, password reset, multi-membership, and TOTP MFA). Swap Cognito for Auth0/Clerk/OIDC by implementing the adapter; nothing else changes. - Vectros API token cache — short-lived
st_*bearers minted on demand and cached per(tenant, context), with concurrent-mint coalescing and a clear-during-mint race guard. The mint function is injected, so the/developer/*call stays inside the swap point. - MFA — a TOTP enrollment wizard and the
/account2FA pattern. - UI primitives —
AuthCard,PasswordField(+ strength meter),AppLayoutchrome,IntlProviderscaffolding, and the tenant/context switchers. - Version-update banner —
VersionUpdateBannerpolls aversion.jsonmanifest and offers a user-initiated refresh when a newer build is deployed, so a long-open tab never strands on a stale shell.
npm install @vectros-ai/reactThis is a toolkit for an existing app, so it expects a set of peer dependencies the app already provides (React, MUI, TanStack Query, the Vectros SDK, and more) — see Peer dependencies below.
Pre-1.0. The API may change between minor versions until the first stable release.
The consuming app supplies React 19, MUI 7, Emotion, TanStack Query 5, react-intl,
react-router 7, aws-amplify, and @vectros-ai/sdk (all peerDependencies). The
small leaf utilities (jose, qrcode.react, @zxcvbn-ts/*) ship as regular
dependencies.
Apache-2.0.