1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/docs/user_guide/unleash-context.md
Ivar Conradi Østhus fb66aeb8e0
fix: more docs
2021-05-21 22:26:56 +02:00

27 lines
1.3 KiB
Markdown

---
id: unleash_context
title: Unleash Context
---
To standardize a few activation strategies, we also needed to standardize the Unleash context, which contains fields that vary per request, required to implement the activation strategies.
The Unleash context is compromised by a set of predefined fields. The static fields does not change in the life-time of your application, while dynamic fields can change per feature toggle evaluation.
**Static context fields**
- appName: String
- environment: String
**Dynamic context fields**
- userId: String,
- sessionId: String,
- remoteAddress: String,
- properties: Map<String, String>
All fields are optional, but if they are not set you will not be able to use certain activation strategies. E.g., the `userWithId` strategy obviously depends on the `userId` field.
The `properties` field is more generic and can be used to provide more arbitrary data to strategies. Typical usage is to add more metadata. For instance, the `betaUser` strategy may read a field from `properties` to check whether the current user is a beta user.
In Unleash Enterprise you may also pre-configure all you customer context fields (`properties`) and use them together with [strategy constraints](../advanced/strategy_constraints) to compose any target rules you need.