@aimform/auth-react
v0.3.3
Published
Aimform Auth React — login, signup, and consent UI components for React apps.
Downloads
492
Maintainers
Readme
@aimform/auth-react
Login, signup, and consent UI components for React apps using the Aimform auth platform.
This package is the Identity React binding. Its implementation lives under
sdk/typescript/bindings/react; Trust semantics remain owned by
@aimform/identity.
npm install @aimform/auth-reactQuick Start
import { AuthProvider, useAuth, LoginForm, GoogleSignInButton } from "@aimform/auth-react";
function App() {
return (
<AuthProvider authUrl="https://api.aimform.com/api/auth">
<LoginPage />
</AuthProvider>
);
}
function LoginPage() {
const { login, isLoading } = useAuth();
return (
<>
<LoginForm onSubmit={login} />
<GoogleSignInButton clientId="..." redirectUri="..." />
</>
);
}Exports
| Export | Purpose |
|--------|---------|
| AuthProvider | Auth context provider |
| useAuth() | Hook — { user, isLoading, error, login, register, logout } |
| LoginForm | Email + password login |
| SignupForm | Email + password registration |
| GoogleSignInButton | Google OAuth button |
| getGoogleOAuthUrl | Generate Google consent URL |
License
MIT © Universal Reason LLC
