@torii-js/core
v0.10.1
Published
Framework-agnostic core for Torii: types, locales, utilities, and session management
Readme
@torii-js/core
Framework-agnostic core for Torii authentication — the shared foundation that the framework SDKs build on: types, locales, session management, and auth utilities, with zero framework dependencies.
📚 Full documentation: docs.toriiauth.eu
Do you need this package?
Most apps should install a framework SDK instead, which re-exports everything here and adds the components and hooks:
- React →
@torii-js/torii-react
Install @torii-js/core directly only if you're building a headless or
custom integration (or a new framework binding) and want the primitives on
their own.
Installation
npm install @torii-js/core
# or: pnpm add / yarn addWhat's inside
- Types — the shared TypeScript surface (
User, label types, theme tokens, error codes, …). - Session management —
SessionManager, the authenticated fetcher, and JWT helpers (decodeJwt,extractUserFromToken, …). - Auth utilities —
parseAuthResult,clearAuthFragment,decodeFapiUrl, locale detection, and OAuth-provider helpers. - Locales — built-in
enanddalabel sets plus the locale registry. - Theming — the theme presets (
shadcn,mui), token definitions, andappearanceToCss. - Authorization —
checkAuthorizationfor role/permission checks.
License
MIT
