Socket
Book a DemoInstallSign in
Socket

@dyteinternals/utils

Package Overview
Dependencies
Maintainers
1
Versions
41
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dyteinternals/utils

A npm package that exports utility function used across services

latest
Source
npmnpm
Version
3.4.0
Version published
Maintainers
1
Created
Source

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

  • 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.

FAQs

Package last updated on 07 May 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts