Optional
data: FlagsmithConfigGet all the flags for the current environment for a given identity. Will also upsert all traits to the Flagsmith API for future evaluations. Providing a trait with a value of None will remove the trait from the identity if it exists.
a unique identifier for the identity in the current environment, e.g. email address, username, uuid
Optional
traits: { Optional
transient: booleanFlags object holding all the flags for the given identity.
Get the segments for the current environment for a given identity. Will also upsert all traits to the Flagsmith API for future evaluations. Providing a trait with a value of None will remove the trait from the identity if it exists.
a unique identifier for the identity in the current environment, e.g. email address, username, uuid
Optional
traits: { Segments that the given identity belongs to.
Optional
agentPrivate
Optional
analyticsOptional
analyticsOptional
apiPrivate
Optional
cachePrivate
customOptional
customOptional
defaultOptional
enableOptional
environmentOptional
environmentOptional
environmentPrivate
environmentThis promise ensures that the environment is retrieved before attempting to locally evaluate.
Optional
environmentPrivate
getPrivate
getPrivate
getPrivate
getPrivate
getPrivate
getPrivate
getJSONResponseOptional
identitiesOptional
identitiesPrivate
loggerOptional
offlinePrivate
Optional
onOptional
requestOptional
retries
A Flagsmith client.
Provides an interface for interacting with the Flagsmith http API. Basic Usage::
import flagsmith from Flagsmith const flagsmith = new Flagsmith({environmentKey: ''});
const environmentFlags = flagsmith.getEnvironmentFlags();
const featureEnabled = environmentFlags.isFeatureEnabled('foo');
const identityFlags = flagsmith.getIdentityFlags('identifier', {'foo': 'bar'});
const featureEnabledForIdentity = identityFlags.isFeatureEnabled("foo")