• Home
  • Integrations
  • SDKs
  • Guides
  • API docs
    No results for ""
    EXPAND ALL

    EDIT ON GITHUB

    Built-in user attributes

    Read time: 1 minute
    Last edited: Jul 29, 2022

    Overview

    This topic explains what built-in user attributes are and how to configure them.

    LaunchDarkly allows you to target users based on built-in attributes. To learn more, read Targeting rules.

    Using built-in user attributes

    All built-in user attribute values are strings with the exception of anonymous, which also accepts a boolean.

    LaunchDarkly does not automatically populate built-in attributes

    While LaunchDarkly provides built-in attribute fields for you to fill in, the SDK does not automatically collect any information. If you want to target your users based on any built-in attributes, you must supply their values.

    The exceptions to this are the os and device attributes used by mobile SDKs. Mobile SDKs automatically populate these values.

    Here is a table explaining LaunchDarkly's built-in attributes:

    Attribute keyAttribute example valueNotes
    key"1f2e2d3a"Required for evaluation. This should be unique for each user.
    secondary"2398127"If provided, this attribute is used with a user's key to generate a variation in percentage rollouts.
    ip"10.10.10.10"This attribute should be a valid IP address.
    email"user@example.com"
    name"Jill Jones"
    avatar"http://example.com/avatar.png"This attribute must be an absolute URL to an avatar image for the user. The avatar appears on the Users list.
    firstName"Jill"
    lastName"Jones"
    country"Uganda"
    anonymous"true"This can be a boolean or string value. This attribute prevents the user from appearing on the list. If the anonymous attribute is set to any value other than boolean false or null, LaunchDarkly treats the user as anonymous.
    os25This attribute is available only in mobile SDKs. Mobile SDKs automatically provide a value for the attribute.
    device"Pixel XL marlin"This attribute is available only in mobile SDKs. Mobile SDKs automatically provide a value for the attribute.

    The user key is the only mandatory user attribute. All other user attributes are optional.

    Creating searchable user keys

    You can structure your user keys so they are both searchable and unique. To do this, we suggest adding a searchable term to the beginning of the key, followed by a unique ID. For example, if you wanted to easily search users that encountered a specific service, you could structure the key as follows: service_name:uuid.

    You can view a user's attributes by clicking on the individual user from the Users list.

    You can also use the REST API: Get user