0.4.111 • Published 4 months ago
@api-buddy/firebase v0.4.111
@api-buddy/firebase
Firebase integration for API Buddy. This package provides a set of utilities and hooks for working with Firebase services in your API Buddy projects.
Installation
pnpm add @api-buddy/firebase firebase
Usage
Initialize Firebase
import { firebaseApp, auth, db, storage } from '@api-buddy/firebase';
// Use the initialized services
const user = auth.currentUser;
const usersRef = collection(db, 'users');
const storageRef = ref(storage, 'images/example.jpg');
Environment Variables
Make sure to set these environment variables in your project:
NEXT_PUBLIC_FIREBASE_API_KEY=your-api-key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
NEXT_PUBLIC_FIREBASE_PROJECT_ID=your-project-id
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your-project.appspot.com
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your-messaging-sender-id
NEXT_PUBLIC_FIREBASE_APP_ID=your-app-id
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID=G-XXXXXXXXXX
API Reference
Exports
firebaseApp
: The initialized Firebase app instanceauth
: Firebase Authentication servicedb
: Firestore database instancestorage
: Firebase Storage instanceisFirebaseInitialized()
: Check if Firebase is initialized
License
MIT