3.4.0 • Published 6 months ago

@dyteinternals/utils v3.4.0

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
6 months ago

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/utils

or if using yarn:

yarn add @dyteinternals/utils

Usage Example

Flagsmith

  1. Import flagsmith
import { globalFlagsmith as flagsmith } from '@dyteinternals/utils';
  1. 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.

3.1.1-staging.1

7 months ago

3.4.0

6 months ago

3.3.0

7 months ago

3.2.0

7 months ago

3.1.1

10 months ago

3.1.0

11 months ago

3.0.0

2 years ago

2.1.0

2 years ago

1.12.0

2 years ago

1.11.1

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.10.3

2 years ago

1.10.2

2 years ago

1.9.4

2 years ago

1.11.0

2 years ago

1.10.1

2 years ago

1.10.0

2 years ago

1.9.1

3 years ago

1.8.2

3 years ago

1.9.0

3 years ago

1.8.1

3 years ago

1.8.0

3 years ago

1.7.10

3 years ago

1.7.11

3 years ago

1.7.9

3 years ago

1.7.8

3 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.7.7

3 years ago

1.7.6

3 years ago

1.7.5

3 years ago

1.7.4

3 years ago

1.7.3

3 years ago

1.7.2

3 years ago

1.7.1

3 years ago

1.7.0

3 years ago

1.6.5

3 years ago

1.6.4

3 years ago

1.6.3

3 years ago

1.6.2

3 years ago