FirebaseConfig
The FirebaseConfig interface defines the essential configuration settings required to initialize a Firebase application. These credentials allow your application to connect to and interact with various Firebase services.
Properties
apiKey:stringYour web API Key from Firebase project settings.authDomain:stringThe authentication domain for your Firebase project.projectId:stringThe unique identifier for your Firebase project.storageBucket:stringThe default Cloud Storage bucket for your Firebase project.messagingSenderId:stringThe sender ID for Firebase Cloud Messaging.appId:stringThe App ID for your Firebase web app.
Usage
The FirebaseConfig interface is typically used within the main AppConfiguration object to provide Firebase initialization settings to the application. The ConfigProvider component consumes this configuration to initialize the Firebase app.
// Example structure within firebase.config.json or similar configuration
interface AppConfiguration {
firebase?: FirebaseConfig; // Using FirebaseConfig type here
// ... other config properties
}
const firebaseConfig: FirebaseConfig = {
apiKey: "AIzaSyC_YOUR_API_KEY",
authDomain: "your-project-id.firebaseapp.com",
projectId: "your-project-id",
storageBucket: "your-project-id.appspot.com",
messagingSenderId: "1234567890",
appId: "1:1234567890:web:abcdef123456"
};
// In your application's main entry point (e.g., App.tsx):
import { ConfigProvider } from '@fireact.dev/app';
import { initializeApp } from 'firebase/app'; // Firebase SDK import
function App() {
// Firebase app initialization happens internally within ConfigProvider
return (
<ConfigProvider firebaseConfig={firebaseConfig} appConfig={yourAppConfig}>
{/* Your application components */}
</ConfigProvider>
);
}
Related Interfaces/Components
AppConfigurationinterface: Contains thefirebasefield of typeFirebaseConfig.ConfigProvidercomponent: Initializes the Firebase app usingFirebaseConfig.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.