1 | ---
|
2 | id: unleash_context
|
3 | title: Unleash Context
|
4 | ---
|
5 |
|
6 | To standardise a few activation strategies, we also needed to standardise the Unleash context, which contains fields that vary per request, required to implement the activation strategies.
|
7 |
|
8 | The unleash context is defined by these fields:
|
9 |
|
10 | - userId: String,
|
11 | - sessionId: String,
|
12 | - remoteAddress: String,
|
13 | - properties: Map<String, String>
|
14 |
|
15 | All fields are optional, but if they are not set you will not be able to use certain activation strategies.
|
16 |
|
17 | E.g., the `userWithId` strategy obviously depends on the `userId` field.
|
18 |
|
19 | The `properties` field is more generic and can be used to provide more abritary 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.
|