open-feature/flagd

[DOC] Create "example targeting" page

Closed this issue · 0 comments

Change in the documentation

Create a page with some example targeting, from simple to advanced. The should be as easy to understand as possible and cover realist use-cases. Here are some examples:

  • return a particular variant if user locale matches a particular locale
  • return a particular variant if user email domain is in a set of hard-coded domains
  • return a particular variant if version is within some range
  • return a particular variant if user is an admin, otherwise do a 4-way fractional split
  • return a particular variant if the date is after some date
  • over a series of dates (at least 3), progressively shift a 2-way fractional split from 90/10 to 0/100
  • more?

If you have no experience using flagd, this is a great first issue.

Simply start flagd and point it to a config file with the samples above: flagd start -f file:my-file.json then curl it:

curl -X POST 'http://localhost:8013/schema.v1.Service/ResolveString'  -d "{\"flagKey\":\"myFlag\",\"context\":{\"myKey\":\"myValue\"}}" -H "Content-Type: application/json"