How can we help?

How does the user key work? What about anonymous users?

When you request a feature flag, you need to pass in a user object. The only mandatory field is the key. In JSON, this looks like this:

{"user": ""}

The only requirement for keys is that they uniquely identify the user visiting your site. For authenticated users, an e-mail address or the primary key of that user from your database makes a perfect user key. For unauthenticated users, a session ID or UUID works– as long as the same session ID or UUID is associated with the same anonymous user on repeat visits to your site.

Anonymous users work just like regular users, except they aren't stored in the dashboard. To indicate that a user should be anonymous, simply include  "anonymous": true in your user object.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request