Repository navigation
Closed
14 / 1414 of 14 issues completedLabels
apiIssue related to the REST APIIssue related to the REST APIedge-apiRelated to edge.api.flagsmith.comRelated to edge.api.flagsmith.comsdkIssues related to the SDKsIssues related to the SDKs
Description
Goal
To support additional use cases, such as evaluating identities in different contexts or managing anonymous identities, we aim to enable our SDK users to:
- Evaluate flags against identities without persisting them.
- Evaluate flags against identities while persisting only a subset of identity traits.
Solution Proposal
Make /api/v1/identities endpoints support optional boolean "transient" attributes both for the top-level identity object and a trait object.
Don't persist identities and traits marked as transient.
In SDKs, support transient: bool and transientTraits: list[str] optional keywords for the getIdentityFlags interface.
Related issues and discussions
Customer requests and use case discussions:
- Anonymous Identities #168, Support for anonymous identity and trait evaluations #77
- Epic: Implement Identity Contexts #1840, Identity Contexts #1839
API tasks:
- Support transient identities and traits in Core APIÂ #4279
- Support blank identifiers, assume transient #4448
- https://github.com/Flagsmith/edge-api/issues/271
- https://github.com/Flagsmith/edge-api/issues/275
SDK tasks:
- Support transient identities and traits flagsmith-python-client#88
- Support transient identities and traits flagsmith-js-client#236
- Support transient identities and traits flagsmith-kotlin-android-client#52
- Support transient identities and traits flagsmith-flutter-client#62
- Support transient identities and traits flagsmith-php-client#74
- Support transient identities and traits flagsmith-elixir-client#35
- Support transient identities and traits flagsmith-ruby-client#63
- Support transient identities and traits flagsmith-go-client#132
- Support transient traits flagsmith-rust-flag-engine#14 + Support transient identities and traits flagsmith-rust-client#22
- Support transient identities and traits flagsmith-java-client#152
- Support transient identities and traits flagsmith-dotnet-client#104
- Support transient identities and traits flagsmith-nodejs-client#156
- Support transient identities and traits flagsmith-ios-client#63
Metadata
Metadata
Assignees
Labels
apiIssue related to the REST APIIssue related to the REST APIedge-apiRelated to edge.api.flagsmith.comRelated to edge.api.flagsmith.comsdkIssues related to the SDKsIssues related to the SDKs
Activity
novakzaballa commentedon Jul 4, 2024
@khvn26 I understand that we should implement transient traits because it is a quick and cost-effective way to cover some of the use cases related to contexts. While it could also help with anonymous identities or other use cases, we should keep the scope restricted to transient traits since that is the reason we decided to move ahead with its implementation.
Also, as mentioned in this Notion regarding Anonymous identities https://www.notion.so/flagsmith/Anonymous-identities-904943c595474ae3b792f935109fb6f6 I think that for most we should persist annonymous identities or at least offer that option for most of the real use cases.
novakzaballa commentedon Jul 4, 2024
Regarding the implementation, I would rather suggest to add a boolean attribute to the trait model, so you can specify and persist whether it is transient or not. That would allow customers to design the behavior of flags, and would allow transient flags without changes to the SDKs. We could also allow SDKs to request a trait to be marked as transient, but that would be optional.
khvn26 commentedon Jul 4, 2024
@novakzaballa I agree with this. However, not all SDKs expose the trait model; some, mainly the server-side ones, accept a simple string to value mapping instead. I suggest we use the
transientTraits: list[str]parameter for those and add atransientboolean property to theTraitmodel for SDKs that support them in their public interfaces.novakzaballa commentedon Jul 4, 2024
Agreed @khvn26
khvn26 commentedon Jul 24, 2024
As discussed here and offline, we're choosing to leave out the additional parameter in favour of extending the
trait_valueparameter type. In addition to currentTraitValue | nulltype, the parameter should accept a mapping/object: