This document explains how to configure Firebase Remote Config for the Google Cloud Skills Boost Helper extension.
Firebase Remote Config has been integrated to allow dynamic configuration of the countdown timer without requiring extension updates. This enables remote control of:
- Countdown deadline time
- Timezone settings
- Enable/disable countdown display
- Countdown title (future use)
- Go to Firebase Console
- Create a new project or use existing one
- Enable Remote Config in your Firebase project
Copy .env.example to .env and update with your Firebase configuration:
cp .env.example .envEdit .env file with your Firebase project configuration:
# Firebase Configuration
WXT_FIREBASE_API_KEY=your-actual-firebase-api-key
WXT_FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com
WXT_FIREBASE_PROJECT_ID=your-actual-project-id
WXT_FIREBASE_STORAGE_BUCKET=your-project.firebasestorage.app
WXT_FIREBASE_MESSAGING_SENDER_ID=your-actual-sender-id
WXT_FIREBASE_APP_ID=your-actual-app-id
# Remote Config Settings (optional - defaults provided)
WXT_FIREBASE_FETCH_INTERVAL_MS=3600000
WXT_FIREBASE_FETCH_TIMEOUT_MS=60000
# Default Remote Config Values (optional - defaults provided)
WXT_COUNTDOWN_DEADLINE=2025-10-14T23:59:59+05:30
WXT_COUNTDOWN_TIMEZONE=+05:30
WXT_COUNTDOWN_ENABLED=trueImportant: Add .env to your .gitignore file to avoid committing sensitive configuration.
If environment variables are not provided, the service will use fallback values. This ensures the extension works even without proper environment setup, but you should configure environment variables for production use.
Set up these parameters in Firebase Console > Remote Config:
| Parameter | Type | Default Value | Description |
|---|---|---|---|
countdown_deadline |
String | "2025-10-14T23:59:59+05:30" |
ISO 8601 datetime string for facilitator deadline |
countdown_timezone |
String | "+05:30" |
Timezone offset (IST in this case) |
countdown_enabled |
Boolean | true |
Whether to show facilitator countdown (when false, hides entire countdown section) |
countdown_deadline_arcade |
String | "<year>-12-31T23:59:59+00:00" |
ISO 8601 datetime string for arcade deadline (defaults to end of current year) |
countdown_enabled_arcade |
Boolean | true |
Whether to show arcade countdown timer |
countdown_deadline:
2025-10-14T23:59:59+05:30
countdown_timezone:
+05:30
countdown_enabled:
true
countdown_deadline_arcade:
2024-12-31T23:59:59+00:00
countdown_enabled_arcade:
true
services/firebaseService.ts: Main Firebase Remote Config servicetypes/firebase.ts: TypeScript type definitionsservices/popupUIService.ts: Updated to use Remote Config for countdownentrypoints/popup/main.tsx: Updated to use Firebase-powered countdown
firebaseService.initialize(): Initialize Firebase and Remote ConfigfirebaseService.getCountdownDeadline(): Get countdown deadline from Remote ConfigfirebaseService.isCountdownEnabled(): Check if countdown is enabledfirebaseService.refreshConfig(): Manually refresh Remote Config
The implementation includes graceful fallbacks:
- If Firebase initialization fails, default values are used
- If Remote Config fetch fails, cached/default values are used
- Console logging for debugging Firebase issues
Open browser DevTools console and run:
// Test Firebase initialization
await firebaseService.initialize();
// Get current config
firebaseService.getAllParams();
// Check configuration source and settings
firebaseService.getConfigInfo();
// Test countdown with current config
PopupUIService.startFacilitatorCountdown();
// Refresh Remote Config
await firebaseService.refreshConfig();
// Test remote countdown toggle functionality
firebaseService.testCountdownToggle();For local development, you can:
- Use environment variables: Create
.envfile with your configuration - Check configuration source: Use
firebaseService.getConfigInfo()to verify which source is being used - Set development cache interval: Set
WXT_FIREBASE_FETCH_INTERVAL_MS=0in.envto bypass caching
# Development settings
WXT_FIREBASE_FETCH_INTERVAL_MS=0 # Immediate fetch for development
WXT_FIREBASE_FETCH_TIMEOUT_MS=10000 # Shorter timeout for developmentFor production, use appropriate cache intervals:
this.remoteConfig.settings = {
minimumFetchIntervalMillis: 3600000, // 1 hour
fetchTimeoutMillis: 60000, // 1 minute
};- Update Remote Config parameters in Firebase Console
- Changes take effect based on
minimumFetchIntervalMillissetting - No extension update required for configuration changes
- Firebase config contains public API keys (this is normal for client-side apps)
- Use Firebase Security Rules if needed for additional protection
- Remote Config parameters are public (don't store sensitive data)
- Firebase not initialized: Check console for initialization errors
- Wrong countdown time: Verify
countdown_deadlineparameter format - Countdown not showing: Check
countdown_enabledparameter - Timezone issues: Verify
countdown_timezoneformat
Enable debug logging by checking browser console:
// Check Firebase initialization status
("Firebase initialized:", firebaseService.isInitialized());
// Check current Remote Config values
("Config:", firebaseService.getAllParams());
// Check countdown configuration
("Countdown config:", firebaseService.getCountdownConfig());Potential future Remote Config parameters:
countdown_title: Customizable countdown titlecountdown_message: Custom message when countdown endsmilestone_bonus_multiplier: Dynamic bonus point multiplierfeature_flags: Enable/disable specific featuresnotification_settings: Control notification behavior
The countdown timer can be remotely enabled or disabled through Firebase Remote Config without requiring users to update the extension.
- Remote Config Parameter:
countdown_enabled(boolean) - Real-time Updates: Configuration is checked every 5 minutes automatically
- Immediate Effect: Changes apply the next time the popup is opened or refreshed
- Graceful Fallback: If Remote Config fails, uses environment variable or default value
- Disable countdown globally: Set
countdown_enabledtofalsein Firebase Console - Enable countdown for event: Set
countdown_enabledtotruebefore event starts - Testing different deadlines: Change
countdown_deadlinewithout extension updates - Emergency disable: Quickly disable countdown if needed
- Enabled: Shows countdown timer with live updates
- Disabled: Shows "Countdown Disabled" message with pause icon
- Loading: Shows default state while Remote Config loads
The extension automatically monitors Remote Config changes every 5 minutes and applies updates without user intervention.
The implementation automatically falls back to hardcoded values if Firebase fails, ensuring backward compatibility. Original hardcoded deadline was:
const deadline = new Date("2025-10-14T23:59:59+05:30");This is now the default value in Remote Config, maintaining the same behavior while enabling remote updates.