SDK Reference
Developer SDKReference
Complete API reference for the EasyAuth JavaScript SDK. Everything you need to integrate secure authentication into your React applications.
Quick Start GuideAuthentication
Complete authentication methods including login, logout, registration, and password management.
signIn()
signOut()
signUp()
resetPassword()
Explore Documentation
Session Management
Handle user sessions, tokens, and authentication state across your application.
getUser()
getToken()
refreshToken()
clearSession()
Explore Documentation
React Hooks
Modern React hooks for seamless integration with your components and state management.
useAuth()
useUser()
useSession()
usePermissions()
Explore Documentation
Error Handling
Comprehensive error handling patterns and custom error types for robust applications.
AuthError
NetworkError
ValidationError
TokenError
Explore Documentation
Get Started in Minutes
Here's a complete example to get you started with the EasyAuth SDK
App.jsx
import { EasyAuthProvider, useAuth } from 'easy.auth98';
function App() {
return (
<EasyAuthProvider
domain="your-domain.easyauth98.com"
clientId="your-client-id"
>
<Dashboard />
</EasyAuthProvider>
);
}
function Dashboard() {
const { user, isAuthenticated, signIn, signOut } = useAuth();
return (
<div>
{isAuthenticated ? (
<div>
<h1>Welcome, {user.name}!</h1>
<button onClick={signOut}>Sign Out</button>
</div>
) : (
<button onClick={signIn}>Sign In</button>
)}
</div>
);
}
Installation
Install the EasyAuth SDK using your preferred package manager:
npm
npm install easy.auth98
yarn
yarn add easy.auth98
pnpm
pnpm add easy.auth98