Skip to content

Configuration

A key goal of this SDK is that it manages its configuration as transparently as possible; but without the need for human intervention. This means that you should be able to access and modify any configuration value, at any time, and the internals of the SDK should respect your updated values.

Under the hood, the Config Bag is a standard JavaScript Map

The Config Bag uses events to update any uncoupled dependants. For example, the Http Client subscribes to changes to the base_url to ensure that it remains up-to-date. Here's what this looks like:

config.on('base_url.updated', (value) => {
client.defaults.baseURL = value;
});
View Source
Edit this page on GitHub
2 contributorssamb20Smudge3806
Last edited by samb20 on September 4, 2020