Remote Configuration
Manage app settings and feature flags remotely without code deployments.
Overview
Remote Config allows you to control your app's behavior from the Resync dashboard. Change settings, toggle features, and update configurations instantly.
Use Cases
- Feature Flags - Enable/disable features remotely
- API Endpoints - Update backend URLs
- App Settings - Modify timeouts, limits, and thresholds
- A/B Test Configuration - Control experiment parameters
- Emergency Switches - Kill switches for problematic features
Getting Started
1. Create Config in Dashboard
- Go to Remote Config in your dashboard
- Click Add Config
- Set key-value pairs:
ENABLE_NEW_UI: true
API_TIMEOUT: 5000
MAX_RETRIES: 3
2. Access in Your App
import { useResync } from 'resync-react-native';
const { getConfig } = useResync();
// Get config values
const newUIEnabled = getConfig('ENABLE_NEW_UI');
const apiTimeout = getConfig('API_TIMEOUT');
const maxRetries = getConfig('MAX_RETRIES');
if (newUIEnabled) {
renderNewUI();
} else {
renderLegacyUI();
}
Config Types
Boolean Flags
const { getConfig } = useResync();
const darkModeEnabled = getConfig('ENABLE_DARK_MODE');
// Returns: true or false
Numeric Values
const timeout = getConfig('REQUEST_TIMEOUT');
// Returns: 5000
String Values
const apiUrl = getConfig('API_BASE_URL');
// Returns: "https://api.example.com"
Objects
const apiSettings = getConfig('API_SETTINGS');
// Returns: { timeout: 5000, retries: 3, baseUrl: "..." }
Real-time Updates
Subscribe to config changes:
Resync.subscribe(() => {
console.log('Config updated:');
updateAppSettings();
});
Best Practices
- Set Defaults - Always provide fallback values
- Document Configs - Add descriptions in dashboard
- Test Changes - Use sandbox environment first
- Monitor Impact - Track metrics after config changes