Dynamic users targeting
To use dynamic targeting rules pass user data to the fetchFeatureFlags and configure rules on the Feature settings page.
There are two operators available in rules:
- equals (for a string value),
- includes (for an array of strings value).
Targeting rules can be used together with the feature coverage by percent of users.
Example
- Filter by email
const featureFlags = await flags.fetchFeatureFlags({
id: '1',
data: {
email: '[email protected]'
}
})
- Filter by company id
const featureFlags = await flags.fetchFeatureFlags({
id: '1',
data: {
companyId: '1'
}
})