Skip to content

Latest commit

 

History

History
29 lines (19 loc) · 1.17 KB

2.FeatureflowClient.md

File metadata and controls

29 lines (19 loc) · 1.17 KB

FeatureflowClient

What is this?

This is the returned client instance returned from Featureflow.init(...). It contains the Features for the apiKey's environment.

Once instantiated, you should assume that the user will reference this instance for the lifetime of their application.

For the purpose of this document, assume that featureflow is the instantiated client from Featureflow.init(...).

Constructor

new featureflow(apiKey, [config])

When instantiating the featureflow client you should perform the following:

  • Create a local PollingClient service instance with the apiKey
  • Create a local FeatureflowEvents service instance with the apiKey
    • Send a featureflow event to register the features in config.withFeatures

Interface

featureflow.evaluate(featureKey, [user])

  • Returns: an instantiated Evaluate object
  • Arguments:
    • featureKey* The key of the feature to evaluate
    • user The current user of the request (if applicable) -> See User

Up Next: 3. Evaluate