Contexts
Contexts are the foundation of feature flag targeting in LaunchDarkly. Understanding how to define and use contexts effectively is critical for successful feature flag implementation.
What are contexts
Contexts represent the entities you want to target with feature flags. A context can be a user, session, device, application, request, or any other entity relevant to your use case.
Each context consists of:
- Key: A unique identifier for the context
- Attributes: Additional data used for targeting and rollouts
Targeting rules evaluate against one or more contexts to determine which variation of a feature flag to serve.
Outcomes
By understanding contexts, you will:
- Know more about contexts, what information to pass, and how to organize it
- Understand the best practices for passing data to the LaunchDarkly SDK
- Be able to successfully pass information to the SDK to be leveraged for feature flags
Topics
This section covers:
- Context fundamentals: Learn about keys, attributes, and meta attributes
- Client vs server SDKs: Understand how context handling differs between SDK types
- Choosing keys and attributes: Best practices for selecting identifiers and attributes
- Automatic attributes: Platform-provided context data
- Best practices: Do’s and don’ts for context implementation
- Context types: Detailed documentation of each context type used in your organization