Skip to content

Commit c7966dc

Browse files
committed
add EventSource polyfill instructions
1 parent 0095ac8 commit c7966dc

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,17 @@ The LaunchDarkly client-side JavaScript SDK supports the following browsers:
2020

2121
\* These browsers do not support streaming new flags to connected clients, even when `client.on('change')` is called.
2222

23+
### `EventSource` Polyfill
24+
25+
If you need streaming support, but your browser does not support `EventSource` natively, you can install a polyfill, such
26+
as [eventsource](https://www.npmjs.com/package/eventsource).
27+
28+
You can load the polyfill via a script tag in the `<head>` before the script where you initialize `LDClient`:
29+
30+
<script src="/public/eventsource-polyfill.js"></script>
31+
32+
If you use [webpack](https://webpack.github.io/) or [browserify](http://browserify.org/), make sure to require the polyfill before `LDClient` is initialized.
33+
2334
## Installation
2435

2536
There are two ways to install the client-side SDK:

0 commit comments

Comments
 (0)