Custom member experience for Bitsacco - a comprehensive Bitcoin SACCO platform built on BitsaccoServer for users in Kenya.
This app uses FeatBit for feature flag management. Feature flags allow toggling features on and off without deploying new code.
The feature flag system is implemented using the FeatBit JavaScript SDK with the builder pattern:
// Initialize client with FbClientBuilder
const client = new FbClientBuilder()
.envSecret(secret)
.api(apiUrl)
.user({
id: user.id,
name: user.name,
email: user.email,
custom: {},
})
.bootstrap(DEFAULT_FLAGS)
.build();
Feature flags can be configured in two ways:
JSON Configuration File (recommended)
The app now supports reading feature flags from a JSON file that can be injected into the Docker container at runtime. This allows for easier configuration and deployment of feature flags in different environments.
To use this method:
features.json file with your feature flag configuration:{
"features": [
{
"id": "membership",
"variationType": "boolean",
"variation": true
},
{
"id": "personal-savings-withdraw",
"variationType": "boolean",
"variation": false
}
// Add other feature flags as needed
]
}
/app/build/features.json when running the container:docker run -v ./config-features.json:/app/build/features.json bitsacco/app
Environment Variables
TBD
import { useFeatureFlags } from "../components/Providers";
import { FEATURE_FLAGS } from "../services/featbit";
function MyComponent() {
const { isEnabled } = useFeatureFlags();
const isWithdrawEnabled = isEnabled(FEATURE_FLAGS.PERSONAL_SAVINGS_WITHDRAW);
// Rest of component
}
Content type
Image
Digest
sha256:4e0c3a5b9…
Size
61.1 MB
Last updated
6 months ago
docker pull okjodom/bitsacco-web:sha-71d5b0f