diff --git a/website/docs/advanced/proxy/endpoints.mdx b/website/docs/advanced/proxy/endpoints.mdx index f81da1bd..5f916e86 100644 --- a/website/docs/advanced/proxy/endpoints.mdx +++ b/website/docs/advanced/proxy/endpoints.mdx @@ -1520,6 +1520,40 @@ evtSource.onmessage = (event) => { +
+ GETOPTIONS/sse/notify/k/{data} + +This endpoint subscribes to all feature flags' changes behind the given SDK key. When it receives a change, the Proxy sends a notification signal to each connected client. +This endpoint doesn't evaluate feature flags. + +**Route parameters**: +- `data`: The `base64` encoded input data that contains the SDK key. + +**Responses**: + + +**Example**: +```js title="example.js" +const rawData = { + // highlight-next-line + sdkKey: "#YOUR-SDK-KEY#" +}; + +const data = btoa(JSON.stringify(rawData)); +// highlight-next-line +const evtSource = new EventSource("http://localhost:8050/sse/notify/k/" + data); +evtSource.onmessage = () => { + console.log("notification received"); +}; +``` + +
+ ### Endpoints using SDK identifier The following endpoints are using an SDK identifier to determine which config / environment is the target of the desired action. @@ -1626,6 +1660,34 @@ evtSource.onmessage = (event) => { +
+ GETOPTIONS/sse/{sdkId}/notify + +This endpoint subscribes to all feature flags' changes behind the given [SDK identifier](overview.mdx#sdk-identifier--sdk-key). When it receives a change, the Proxy sends a notification signal to each connected client. +This endpoint doesn't evaluate feature flags. + +**Route parameters**: +- `sdkId`: The [SDK identifier](overview.mdx#sdk-identifier--sdk-key) that uniquely identifies an SDK within the Proxy. + +**Responses**: + + +**Example**: +```js title="example.js" +// highlight-next-line +const evtSource = new EventSource("http://localhost:8050/sse/#SDK-IDENTIFIER#/notify"); +evtSource.onmessage = () => { + console.log("notification received"); +}; +``` + +
+ ### Available Options The following SSE related options are available: diff --git a/website/docs/advanced/proxy/grpc.mdx b/website/docs/advanced/proxy/grpc.mdx index 6bff9e49..96a00527 100644 --- a/website/docs/advanced/proxy/grpc.mdx +++ b/website/docs/advanced/proxy/grpc.mdx @@ -29,6 +29,8 @@ service FlagService { rpc EvalFlagStream(EvalRequest) returns (stream EvalResponse) {} // Stream for getting notified when any feature flag's value changes. rpc EvalAllFlagsStream(EvalRequest) returns (stream EvalAllResponse) {} + // Signal for getting notified upon feature flag data changes. + rpc NotifyStream(Target) returns (stream google.protobuf.Empty) {} // Evaluates a feature flag. rpc EvalFlag(EvalRequest) returns (EvalResponse) {}