Basic Authentication
Sign Up
Sign In
Sign Out
OAuth Authentication
The SDK includes automatic OAuth callback detection (v0.0.14+). When users return from OAuth providers, the SDK automatically handles the authentication.OAuth requires environment variables to be configured on the backend:
GOOGLE_CLIENT_ID
,GOOGLE_CLIENT_SECRET
GITHUB_CLIENT_ID
,GITHUB_CLIENT_SECRET
Session Management
Get Current User
Get Current Session
User Profiles
InsForge separates authentication (system) from profiles (user data):Get Any User’s Profile
Update Current User’s Profile
React Hook Example
Create a reusable auth hook for React applications:Protected API Calls
The SDK automatically includes authentication tokens for all requests:Error Handling
Auth operations return structured errors:Token Storage
Browser
Tokens stored in localStorage automatically
Node.js
In-memory Map storage by default
React Native
Provide custom storage via config
Custom
Implement your own storage adapter
Security Features
- JWT Tokens - Access tokens valid for 7 days
- Automatic Refresh - SDK handles token renewal
- Password Hashing - Bcrypt with salt rounds
- Rate Limiting - Built-in protection against brute force
- CSRF Protection - Automatic for session-based auth