Floodgate Docs

The User Object

With Floodgate you have the ability to customise the value of a feature flag on a per user basis. To achieve this you need to create a User Object for each of your application users. The User Object contains data about the current user which in turn you can use in your flag configuration.

About the User Object

The User Object is the way Floodgate uniquly identifies your users. As a developer you can add as much data as you require to the user objects you create. This data can then be used by product managers to decide what feature values are served to the specific users.

Security and User Data Even though Floodgate requires data about your users to allow for targeted flag evaluations, this data is never sent to the Floodgate servers. All evaluations are done locally on your servers within your application.

User Object Properties

Every User Object you create needs to be initalised with a unique id to identify the user. The table below shows the properties that make up the User Object.

PropertyRequired?TypeDescription
User IdYesstring Every user is required to be assigned a unique id. This could be a database id or the users email address for example. Session IDs or UUIDs are suited best.
Email NostringYou can optionally set the users email address if you would like to evaluate against specific users emails.
Custom AttributesNoArray/ListEach user can have any number of custom attibutes assigned to them. This is a very powerful feature of Floodgate as it gives you the flexability to evaluate flags against any data element that may belong to your users. The SDK you are using will determine the exact data type of the custom attributes.

Creating User Object Example

Below is an example of the creation of a User Object in .NET user the Floodgate .NET SDK.

var customAttributes = new Dictionary() {
{ "name", "Peter Parker" },
{ "subscription", "Gold" },
{ "country", "UK" },
{ "role", "Admin" }
};
User user = new User("a-unique-id")
{
Email = "[email protected]",
CustomAttributes = customAttributes
};