Authentication

Secure user authentication for your application

Add secure authentication to your app with just a few lines of code.

Supported Providers

Email

Email and password authentication

Google

Sign in with Google

GitHub

Sign in with GitHub

Quick Setup

1
Install the SDK
npm install @demo/auth
2
Initialize
import { Auth } from '@demo/auth';

const auth = new Auth({
  apiKey: 'your-api-key'
});
3
Add Sign In
await auth.signIn({
  email: 'user@example.com',
  password: 'secure-password'
});

Session Management

Sessions are automatically managed and persisted. User state is available across page reloads.

// Check current user
const user = auth.currentUser;

// Listen for auth changes
auth.onAuthStateChange((user) => {
  console.log('User:', user);
});