1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-12-28 00:06:53 +01:00
unleash.unleash/website/docs/user_guide/unleash-context.md

27 lines
1.3 KiB
Markdown
Raw Normal View History

---
id: unleash_context
title: Unleash Context
---
2021-05-21 22:26:56 +02:00
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 composed of a set of predefined fields. The static fields do not change in the life-time of your application, while dynamic fields can change per feature toggle evaluation.
2021-05-21 22:26:56 +02:00
**Static context fields**
- appName: String
- environment: String
**Dynamic context fields**
- userId: String,
- sessionId: String,
- remoteAddress: String,
- properties: Map<String, String>
2021-05-21 22:26:56 +02:00
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.
2021-05-21 22:26:56 +02:00
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.