@tabulariumai/aurora-auth
v0.0.3
Published
Shared Tabularium React authentication package with Microsoft sign-in, session management, and backend-provided access flags that prevent client apps from attempting unauthorized actions.
Maintainers
Readme
@tabulariumai/aurora-auth
Shared Tabularium React authentication package for Microsoft sign-in, backend session exchange and refresh, session restoration, recovery, and sign-out.
Authorization access
The backend remains the authorization authority. Login and refresh responses
provide access flags, and Aurora Auth stores them on session.access for client
applications to check before presenting or attempting restricted actions.
import { useAuthStore } from "@tabulariumai/aurora-auth";
const canUseSubscriptionBatches = useAuthStore(
(state) => state.session?.access.subscription_batches === true,
);Client-side checks avoid unavailable requests; backend endpoints must still enforce authorization independently.
Install
npm install @tabulariumai/aurora-authReact and React DOM remain owned by the consuming application and must satisfy the package peer dependencies.
Exports
The package exports AuthGate, DetailsPanel, useAuth, useAuthStore,
createAuthController, createAuthRuntime, and their public TypeScript types.
AuthGate owns the authentication lifecycle while the host supplies runtime
configuration, assets, loading/ready callbacks, and host rendering.
import { AuthGate } from "@tabulariumai/aurora-auth";
<AuthGate
logoSrc="/assets/tabularium.svg"
onAuthenticated={handleAuthenticated}
onLoaderChange={handleLoaderChange}
onReadyChange={handleReadyChange}
onSignedOut={handleSignedOut}
recoveryKey={recoveryKey}
renderHost={(content) => <main>{content}</main>}
runtimeOptions={authOptions}
>
<App />
</AuthGate>;DetailsPanel displays the authenticated name, email, provider, subscription,
session expiration, and backend access flags. It does not display the session
token or storage timestamp. The host controls where the panel is rendered:
import { DetailsPanel } from "@tabulariumai/aurora-auth";
<DetailsPanel renderHost={(content) => <aside>{content}</aside>} />;Development
npm install
npm run typecheck
npm run lint:boundary
npm test
npm run build
npm pack --dry-runPublic Repository Notes
Generated package archives, dependency folders, build output, test results, and local environment files are not part of the source repository surface. The npm package contains the built runtime, TypeScript declarations, package metadata, license, notice, and documentation.
