@dyteinternals/utils v3.4.0
Utility for Preset & Flag Management
Overview
This repository provides a utility package that facilitates interaction with Flagsmith while also offering various helper functions to manage and convert presets. It is designed to be integrated into a larger project such as web-core.
Features
- Preset Conversion Methods: Includes helper methods to convert preset configurations between different formats.
- Default Preset Values: Contains default preset that can be directly used by other projects.
- Flagsmith Integration: Provides an easy-to-use function to interact with Flagsmith for feature flag management.
Installation and Usage
npm install @dyteinternals/utilsor if using yarn:
yarn add @dyteinternals/utilsUsage Example
Flagsmith
- Import flagsmith
import { globalFlagsmith as flagsmith } from '@dyteinternals/utils';- Identify the user to flagsmith
await flagsmith.identify(
'A_RANDOM_USER_ID',
JSON.parse(JSON.stringify({traitKey1: traitValue1, traitKey2: traitValue:2})),
false, // force evaluate, appends a fake string to userId to make it unique and treat it as new user
5000, // timeout
flagsEndpoint, // default edge.api.flagsmith.com
console, // logs would be passed to console, pass any logger of your choice
);Using Preset Conversion Methods
import {
getDefaultPresetV2,
LivestreamViewerMediaQualityType,
MediaProductionPermissionType,
PresetTypeV2,
RecorderType,
ViewType,
WaitingRoomTypes,
MediaScreenShareQualityType,
MediaVideoQualityType,
PluginAccessControls,
BorderRadius,
BorderWidth,
Theme,
convertHybridPresetToV1,
convertHybridPresetToV2
} from '@dyteinternals/utils';
console.log(getDefaultPresetV2());License
This project is licensed under the Apache v2.0.
7 months ago
6 months ago
7 months ago
7 months ago
10 months ago
11 months ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago