Skip to main content

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

Example

  1. Filter by email
const featureFlags = await flags.fetchFeatureFlags({ 
id: '1',
data: {
email: '[email protected]'
}
})

Email example

  1. Filter by company id
const featureFlags = await flags.fetchFeatureFlags({ 
id: '1',
data: {
companyId: '1'
}
})

Company id example