Flagsmith / Flagsmith/flagsmith-js-client

Feature request: add an event handler on event source received

Open
#330 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
67
Forks
45
Avg merge
1d 8h
Merged PRs (30d)
4

Description

## Problem
At the moment the SDK provides realtime capabilities through `eventSourceUrl` and `realtime` init parameters but it doesn't expose a specific handler when a new event is received.
To add custom logic, it requires to setup the event-source manually

## Solution
A solution could be to add a new handler `onEventSourceReceived` that would be triggered when a new event is received to allow for additional logic independently from `onChange`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the SDK entry points that process the eventSourceUrl and realtime initialization parameters, then compare that flow with the existing onChange handling. Confirm how manually configured event sources deliver events. Done means exposing an onEventSourceReceived handler that runs for each received event independently of onChange, with coverage for the new behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.