Implements

Constructors

Properties

options?: IVWOOptions
originalSettings: Record<any, any>
settings: SettingsModel
storage: Storage

Methods

  • Retrieves the value of a feature flag for a given feature key and context. This method validates the feature key and context, ensures the settings are valid, and then uses the FlagApi to get the flag value.

    Parameters

    • featureKey: string

      The key of the feature to retrieve.

    • context: Record<string, any>

      The context in which the feature flag is being retrieved, must include a valid user ID.

    Returns Record<any, any>

    • A promise that resolves to the feature flag value.
  • Sets an attribute for a user in the context provided. This method validates the types of the inputs before proceeding with the API call.

    Parameters

    • attributeKey: string

      The key of the attribute to set.

    • attributeValue: string

      The value of the attribute to set.

    • context: Record<string, any>

      The context in which the attribute should be set, must include a valid user ID.

    Returns void

  • Tracks an event with specified properties and context. This method validates the types of the inputs and ensures the settings and user context are valid before proceeding.

    Parameters

    • eventName: string

      The name of the event to track.

    • eventProperties: Record<string, dynamic> = {}

      The properties associated with the event.

    • context: Record<string, any>

      The context in which the event is being tracked, must include a valid user ID.

    Returns Promise<Record<string, boolean>>

    • A promise that resolves to the result of the tracking operation.