Skip to content

Commit 5033028

Browse files
add support for configuration export (#63)
* v3.0.3-rc.0 * feat: [add support for getFlagConfigurations from nodejs] (FF-2437)
1 parent 7801cc6 commit 5033028

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,25 @@ const assignmentLogger: IAssignmentLogger = {
111111
};
112112
```
113113

114+
## Export configuration
115+
116+
To support the use-case of needing to bootstrap your front-end client with an Eppo Client SDK, the Eppo NodeJS SDK provides a function to export flag configurations.
117+
118+
Use the `getFlagConfigurations(): Record<string, Flag>` function to export flag configurations, stringify them (or your preferred serialization method), and send it to the front-end client as a part of your routine initialization.
119+
120+
```javascript
121+
import express from 'express';
122+
import * as EppoSdk from "@eppo/node-server-sdk";
123+
124+
const app = express();
125+
const eppoClient = EppoSdk.getInstance();
126+
127+
app.get('/api/flag-configurations', (req, res) => {
128+
const flagConfigurations = eppoClient.getFlagConfigurations();
129+
res.json(flagConfigurations);
130+
});
131+
```
132+
114133
## Philosophy
115134

116135
Eppo's SDKs are built for simplicity, speed and reliability. Flag configurations are compressed and distributed over a global CDN (Fastly), typically reaching your servers in under 15ms. Server SDKs continue polling Eppo’s API at 30-second intervals. Configurations are then cached locally, ensuring that each assignment is made instantly. Evaluation logic within each SDK consists of a few lines of simple numeric and string comparisons. The typed functions listed above are all developers need to understand, abstracting away the complexity of the Eppo's underlying (and expanding) feature set.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,4 +59,4 @@
5959
"node": ">=18.x",
6060
"yarn": "1.x"
6161
}
62-
}
62+
}

0 commit comments

Comments
 (0)