Authentication
The AxonVault SDK handles user authentication via social login providers. All authentication is managed automatically by the SDK.Initialize SDK
Social Login
Google Sign-In
Apple Sign-In
Email Login
Get Current User
Check Authentication Status
Sign Out
Token Management
The SDK automatically manages JWT tokens:- Automatic Refresh: Tokens are refreshed before expiration
- Secure Storage: Tokens stored securely (httpOnly cookies in browser)
- Error Handling: Automatic retry on token expiration
Event Listeners
Listen for authentication events:Error Handling
Best Practices
Security
Security
- Always use HTTPS in production
- Validate ID tokens on your backend if needed
- Don’t store sensitive data in localStorage
- Use httpOnly cookies for token storage (SDK handles this)
UX
UX
- Show loading states during authentication
- Handle errors gracefully with user-friendly messages
- Provide clear sign-out functionality
- Remember user’s last authentication method
Performance
Performance
- SDK caches authentication state
- Tokens are refreshed in background
- Minimal network requests