@farmart-tech/brave-admin-sdk
v2.0.2
Published
Admin SDK for Farmart Brave Ship feature flag system.
Readme
@farmart-tech/brave-admin-sdk
Admin SDK for Farmart Brave Ship feature flag system.
Overview
@farmart-tech/brave-admin-sdk provides full CRUD (Create, Read, Update, Delete) operations for managing feature flags, workspaces, and maintenance windows. This SDK is designed for admin dashboards, management tools, and automation scripts.
Features
- Full CRUD operations for features and workspaces
- Maintenance window management
- Feature flag lifecycle management
- Workspace administration
- Audit log integration
- TypeScript support with complete type definitions
- Real-time synchronization
- Batch operations support
Installation
npm install @farmart-tech/brave-admin-sdk @farmart-tech/brave-firebase-adapter firebase axiosPeer Dependencies
firebase^11.5.0axios^1.6.7
Quick Start
import { createAdminClient } from '@farmart-tech/brave-admin-sdk';
import { FirebaseAdapter } from '@farmart-tech/brave-firebase-adapter';
import { initializeApp } from 'firebase/app';
// Initialize Firebase
const firebaseApp = initializeApp({
projectId: 'your-project-id',
apiKey: 'your-api-key',
// ... other config
});
// Create adapter
const adapter = new FirebaseAdapter({ app: firebaseApp });
// Create admin client
const admin = createAdminClient(adapter);
// Manage workspaces
await admin.createWorkspace({
id: 'workspace-1',
name: 'Production',
description: 'Production environment',
});
// Manage features
await admin.createFeature('workspace-1', {
id: 'feature-dark-mode',
name: 'Dark Mode',
description: 'Enable dark theme',
enabled: true,
rolloutPercentage: 50,
});
// Update feature
await admin.updateFeature('workspace-1', 'feature-dark-mode', {
enabled: false,
rolloutPercentage: 100,
});
// Delete feature
await admin.deleteFeature('workspace-1', 'feature-dark-mode');
// Manage maintenance windows
await admin.setWindowActive('workspace-1', false, {
message: 'System under maintenance',
showLogo: true,
});Documentation
For complete API documentation and usage examples, visit:
https://fmt-feature-management.web.app/docs/admin-sdk/index.html
API Methods
Workspace Management
createWorkspace(workspace)- Create new workspacegetWorkspace(workspaceId)- Get workspace detailsupdateWorkspace(workspaceId, data)- Update workspacedeleteWorkspace(workspaceId)- Delete workspacelistWorkspaces()- List all workspaces
Feature Management
createFeature(workspaceId, feature)- Create feature flaggetFeature(workspaceId, featureId)- Get feature detailsupdateFeature(workspaceId, featureId, data)- Update featuredeleteFeature(workspaceId, featureId)- Delete featurelistFeatures(workspaceId)- List all features in workspace
Window Management
setWindowActive(workspaceId, active, config)- Control maintenance modegetWindowStatus(workspaceId)- Get current window statusscheduleWindow(workspaceId, schedule)- Schedule maintenance window
Use Cases
- Admin dashboards
- CI/CD automation
- Feature flag management tools
- Automated testing environments
- DevOps tooling integration
- Maintenance mode control
License
MIT
Related Packages
- @farmart-tech/brave-client-sdk - Client SDK (read-only)
- @farmart-tech/brave-firebase-adapter - Firebase integration
- @farmart-tech/brave-react-adapter - React hooks
