@farmart-tech/brave-client-sdk
    Preparing search index...

    @farmart-tech/brave-client-sdk

    @farmart-tech/brave-client-sdk

    Lightweight client-side SDK for consuming Brave Ship feature flags and maintenance windows.

    @farmart-tech/brave-client-sdk is the primary entry point for web and mobile applications to consume feature flags. It provides a simplified, read-only interface to the Brave Ship ecosystem, built on top of the performant Firebase adapter.

    • 📖 Read-Only Safety: Designed purely for consumption, preventing accidental modifications.
    • ⚡ Real-time Updates: Reflect feature flag changes instantly without page reloads.
    • 🛡️ Environment Isolation: Dedicated workspaces for production, staging, and development.
    • 📦 Zero-Config Caching: Efficiently caches feature flags and segments locally.
    • 🔍 Full Evaluation: Supports complex targeting and hashing-based rollouts out-of-the-box.
    npm install @farmart-tech/brave-client-sdk
    # or
    pnpm add @farmart-tech/brave-client-sdk
    • firebase ^11.5.0
    • @farmart-tech/brave-firebase-adapter
    import { FeatureFlagReader } from '@farmart-tech/brave-client-sdk';
    import { getFirestore } from 'firebase/firestore';

    // 1. Initialize
    const db = getFirestore(app);
    const reader = new FeatureFlagReader({
    db,
    workspace: 'production',
    userContext: { userId: 'current-user-id' }
    });

    // 2. Simple Check
    const isEnabled = await reader.getFeatureFlag('new_feature').then(f => f?.getIsEnabled());

    // 3. Detailed Evaluation (useful for debugging)
    const details = await reader.getFeatureFlag('experimental_ui').then(f => f?.evaluateWithDetails());
    console.log(`Enabled: ${details.isEnabled}. Reason: ${details.reason}`);
    import { WindowReader } from '@farmart-tech/brave-client-sdk';

    const windowReader = new WindowReader({ db, workspace: 'production' });
    const config = await windowReader.getRemoteConfig('my_web_app');

    if (config?.getIsInMaintenance('web')) {
    // Show maintenance UI
    }

    Comprehensive API documentation is available at: https://fmt-feature-management.web.app/docs/client-sdk/

    MIT © FarMart