feat(issue-506): add loadOptions to segmentPlugin
PR to implement https://github.com/DavidWells/analytics/issues/506
Currently, the Segment plugin initialisation does not allow users to pass the optional second argument, options to the core analytics.load() function. This limits customisation when loading the Segment library.
We request the addition of a new property, loadOptions within the plugin configuration object. This property should accept the desired options object, which will then be passed directly to analytics.load() alongside the writeKey.
Proposed Implementation Change: Instead of the current call:
analytics.load(writeKey);
The plugin should be modified to accept and utilize the loadOptions from the plugin configuration:
const { writeKey, loadOptions } = pluginConfig;
analytics.load(writeKey, loadOptions); // Pass loadOptions as the second argument
Hey @DavidWells, Kindly review this at your earliest convenience. Thank you.