You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: this is a parent ticket, when working on the implementation in a given SDK, there should be a ticket (referenced here) with relevant acceptance criteria defined.
Requirements
On initialisation, the client must open an SSE connection to https://realtime.flagsmith.com/sse/environments/{environment key}/stream.
Whenever a flag changes (or an entity changes which might affect the value of a flag, e.g. a segment) in the Flagsmith Dashboard, an event is sent via the stream. The event will have a type of environment_updated and a body that looks something like {"updated_at": 1689172003.899101} where the value of "updated_at" is an iso timestamp of when the environment was last updated.
Each call to /flags, /identities and /environment-document also includes the X-Environment-Updated-At response header which contains the same value. The clients can use this to initially set the state for this value and then continue to update it by listening to the SSE stream.
The client is expected to maintain a cache of the last time the environment was updated and, when it receives an event on the SSE stream, to determine if the environment was updated more recently and if so, to call the relevant endpoint to retrieve the flags for the environment / identity and update it's local state wherever necessary.
Client Side
Server Side
Note: this is a parent ticket, when working on the implementation in a given SDK, there should be a ticket (referenced here) with relevant acceptance criteria defined.
Requirements
On initialisation, the client must open an SSE connection to
https://realtime.flagsmith.com/sse/environments/{environment key}/stream
.Whenever a flag changes (or an entity changes which might affect the value of a flag, e.g. a segment) in the Flagsmith Dashboard, an event is sent via the stream. The event will have a type of environment_updated and a body that looks something like {"updated_at": 1689172003.899101} where the value of "updated_at" is an iso timestamp of when the environment was last updated.
Each call to
/flags
,/identities
and/environment-document
also includes the X-Environment-Updated-At response header which contains the same value. The clients can use this to initially set the state for this value and then continue to update it by listening to the SSE stream.The client is expected to maintain a cache of the last time the environment was updated and, when it receives an event on the SSE stream, to determine if the environment was updated more recently and if so, to call the relevant endpoint to retrieve the flags for the environment / identity and update it's local state wherever necessary.
See the JS SDK code here for reference.
The text was updated successfully, but these errors were encountered: