Firebase Auth Adapter
@uaif/adapter-firebase-auth implements the AuthContract for Firebase Authentication.
Installation
bash
npm install @uaif/adapter-firebase-authPeer Dependencies
firebase>= 10.0.0
Configuration
json
{
"integrations": {
"auth": {
"provider": "firebase-auth",
"config": {
"projectId": "my-project-id"
}
}
}
}Usage
typescript
import { FirebaseAuthAdapter } from '@uaif/adapter-firebase-auth';
const auth = new FirebaseAuthAdapter({
projectId: process.env.FIREBASE_PROJECT_ID,
});
// Login
const result = await auth.login({
email: 'user@example.com',
password: 'password',
});
// Get current user
const user = await auth.getCurrentUser();Supported Contexts
- Web (React, Next.js)
- Mobile (React Native, Expo)
- Server (Node.js)
Compatibility
| Framework | Status |
|---|---|
| Next.js | ✅ Supported |
| React | ✅ Supported |
| Expo | ✅ Supported |
See Also
- Core Concepts — Understanding the contract system
- API Reference — Complete type signatures