UNPKG

928 BMarkdownView Raw
1# Config
2Isomorphic app config.
3
4**Why?** — we use [node-config](https://github.com/lorenwest/node-config)
5for convenient configuration of our apps. `node-config` itself works in NodeJS
6environment only. This utility exposes the config in isomorphic way that works
7both at server- and client-side.
8
9Use it this way:
10```js
11import { config } from 'topcoder-react-utils';
12
13// Some code relying on the config.
14```
15
16Keep in mind that config still can be different at client- and server-side, due
17to normalization during injection into the HTML page template:
18- Some sensitive config params can be trimmed out of the injected config (by
19 default we remove `SECRET` key);
20- Some extra data can be appended to the config, anything that does not come
21 from `node-config`, and is not stored in Redux state (although, most probably,
22 it should be), but still should be transmitted to the client side and be
23 available inside JS.