@groo.dev/auth-core
v0.2.2
Published
Shared types and utilities for Groo Auth SDK
Readme
@groo.dev/auth-core
Shared types and utilities for the Groo Auth SDK.
Installation
npm install @groo.dev/auth-coreOverview
This package contains core types shared between @groo.dev/auth-react and @groo.dev/auth-server. You typically don't need to install this package directly - it's included as a dependency of the other packages.
Types
import type { User, AuthConfig, AuthContextValue } from '@groo.dev/auth-core'
interface User {
id: string
email: string | null
phone: string | null
name: string | null
role: string
}
interface AuthConfig {
baseUrl: string // Groo accounts service URL
clientId: string // Your application's client ID
redirectUri: string // Where to redirect after login
}
interface AuthContextValue {
user: User | null
isLoading: boolean
error: Error | null
loginUrl: string
logoutUrl: string
refetch: () => Promise<void>
}Related Packages
@groo.dev/auth-react- React hooks and components@groo.dev/auth-server- Server-side middleware for Hono/Cloudflare Workers
License
MIT
