Add support for loading and parsing the configuration file as part of the SDK init #318
Description
Feature Request
At the moment, developers need to provide the JSON object of the configuration when initialise the SDK, here is an example.
In this example, the content of mobile-services.json
is put into a JS file and then required by the user's application. This is due to the fact that JSON format is not universally supported by all the loaders/importers in nodejs/typescript. It is supported by the newer versions of node and typescript, but the older ones don't.
To make it easier for developers to use our SDK, we should handle the loading and parsing of the mobile-services.json
file. It will:
- Make it easier for developers to consume our SDK
- Make it easier for us to document the setup steps.
A possible approach is to allow developers to provide the path to the mobile-services.json
file as part of the SDK initialisation. The SDK will still be backward compatible if the parameter to initialise the SDK is an object. But if the parameter is a String type, the SDK will then load and parse the configuration file and build the configuration object.