@authcore/types
v0.7.0
Published
Core type definitions for AuthCore
Downloads
20
Readme
@authcore/types
Shared TypeScript type definitions for the AuthCore ecosystem.
Install
npm install @authcore/typesWhy this package?
Frontend packages like @authcore/react and @authcore/core-web only need type definitions (e.g. PublicUser), not the full server-side @authcore/core which bundles bcryptjs, jsonwebtoken, and zod. This package provides those types without any runtime dependencies.
Exported Types
Core types
User-- full user record (includespasswordHash, server-side only)PublicUser-- safe user shape returned to clients (nopasswordHash)Token-- token record stored in the databaseTokenType--'EMAIL_VERIFICATION' | 'PASSWORD_RESET' | 'SESSION' | 'INVITATION'
Input types
CreateUserInput-- shape for creating a new userCreateTokenInput-- shape for creating a new token
Adapter interfaces
DatabaseAdapter-- contract for database implementations (Prisma, Drizzle, etc.)EmailAdapter-- contract for email providers (Resend, Nodemailer, etc.)
Configuration types
AuthCoreConfig-- top-level configuration objectSessionConfig-- JWT session settingsEmailConfig-- email provider settingsAuthCallbacks-- optional lifecycle callbacks (onSignUp,onSignIn, etc.)
Usage
import type { PublicUser, DatabaseAdapter, AuthCoreConfig } from '@authcore/types'All types are also re-exported from @authcore/core for convenience.
