@companyio/auth-react
v0.1.32
Published
React provider and hooks for the shared authentication platform
Readme
@companyio/auth-react
React context for sharing an AuthClient, restoring sessions on startup, and reading the current user.
Use
import { AuthProvider, useAuth } from '@companyio/auth-react';
<AuthProvider client={authClient}>
<App />
</AuthProvider>;
function Account() {
const { user, isLoading, signOut } = useAuth();
return isLoading ? <span>Loading...</span> : <button onClick={signOut}>{user?.email}</button>;
}Build
pnpm --filter @companyio/auth-react build