ng-firebase-signals
Version:
A minimal Angular library that provides reactive Firebase utilities using Angular signals
102 lines (77 loc) • 2.44 kB
Markdown
using Angular signals.
```typescript
import { provideFirebase } from '@ng-firebase-signals/core';
import { initializeAuth, signInWithGoogle, userState } from '@ng-firebase-signals/core';
// In your app.config.ts
export const appConfig: ApplicationConfig = {
providers: [
provideFirebase({
apiKey: 'your-api-key',
authDomain: 'your-project.firebaseapp.com',
projectId: 'your-project-id',
storageBucket: 'your-project.appspot.com',
messagingSenderId: '123456789',
appId: 'your-app-id',
googleAI: {
apiKey: 'your-google-ai-key'
}
})
]
};
// In your component
export class AppComponent {
userState = userState;
constructor() {
initializeAuth();
}
async login() {
try {
await signInWithGoogle();
console.log('User signed in!');
} catch (error) {
console.error('Sign in failed:', error);
}
}
}
```
Complete setup and installation guide
Core Firebase configuration and service injection
User authentication with Firebase Auth
Real-time database operations with Firestore
File upload, download, and management with Firebase Storage
Google Generative AI integration for text generation and chat
Practical examples and integration patterns
Complete API documentation for all functions and types
- **Minimal & Focused**: Direct, single-purpose functions
- **Angular Signals**: Reactive state management with Angular signals
- **TypeScript**: Full type safety and IntelliSense support
- **Firebase Integration**: Auth, Firestore, Storage, and Google AI
- **Zero Dependencies**: Only Angular core and Firebase as peer dependencies
- **Tree Shakeable**: Only import what you use
```bash
npm install @ng-firebase-signals/core
```
```json
{
"@angular/common": "^16.0.0",
"@angular/core": "^16.0.0",
"firebase": "^10.0.0",
"@google/generative-ai": "^0.20.0"
}
```
MIT License - see [LICENSE](LICENSE) for details.
A minimal Angular library that provides reactive Firebase utilities