Shared TypeScript types and Zod schemas for the SeamlessAuth ecosystem.
This package provides a single source of truth for domain models like Users, Credentials, Sessions, and Auth Events, ensuring consistency across:
- API servers
- SDKs
- Frontend applications
- CLI tools
- Zod-first schemas with runtime validation and type inference
- Strict typing across all models
- Framework-agnostic
- Minimal dependencies (Zod only)
npm install @seamless-auth/typesimport { UserSchema } from '@seamless-auth/types';const user = UserSchema.parse(data);import type { User } from '@seamless-auth/types';
function handleUser(user: User) {
console.log(user.email);
}All models are defined using Zod:
export const UserSchema = z.object({
id: z.string().uuid(),
email: z.string().email(),
});Types are inferred:
export type User = z.infer<typeof UserSchema>;This package follows semantic versioning:
- PATCH for fixes and non-breaking improvements
- MINOR for additive changes such as new fields or models
- MAJOR for breaking changes such as field removals or type changes
# build
npm run build
# watch mode
npm run dev
# type check
npm run typecheckContributions are welcome.
Please ensure:
- strict TypeScript compliance
- schemas remain Zod-based
- no framework-specific dependencies are introduced
AGPL-3.0 © Fells Code, LLC
- GitHub: https://github.com/fells-code/seamless-auth-types
- SeamlessAuth: https://seamlessauth.com