Documentation Index
Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This topic explains what context attributes are, how to configure them, and how LaunchDarkly uses them to evaluate flags and display flag variations to your customers.About context attributes
Contexts are people, services, machines, or other resources that encounter feature flags in your product. Each context has a context kind that you can use to categorize context instances for targeting and Experimentation. For example, you may know:- the username, first name, last name, and email address of a person. You might include these context attributes in contexts with a “user” context kind.
- the size, region, and location of an office. You might include these context attributes in contexts with an “organization” context kind.
- the configuration details of an environment. You might include these attributes in contexts with a “device” context kind.
Target based on context attributes
You can use context attributes in targeting rules for flags and segments. For example, imagine you want a flag to serve theEnabled variation to user contexts that have a plan type of Beta tester and are in the segment example segment.
Here is an example of that rule:

View and manage context attributes
By default, SDKs send all of a context’s attributes to LaunchDarkly. This data lets LaunchDarkly determine the expected flag variations for contexts and powers the autocomplete functionality throughout the LaunchDarkly UI. You can change the value of an attribute for a context at any time by sending new attributes values to LaunchDarkly from your SDK.Date and time attribute values
Context attributes can include date and time values. LaunchDarkly supports both of the following formats for date and time attributes:- A Unix timestamp, represented as an integer or string, in milliseconds since the Unix epoch
- A date-time string in [RFC 3339](https://www.rfc-editor.org/rfc/rfc
- format, such as
"2024-11-18T00:00:00Z"
before or after operators in targeting rules or segments, LaunchDarkly compares these values as dates. To learn more, read Representations of date and time values.
Try it in your SDK: Identifying and changing contexts
