Closed all-things-liquid closed 4 years ago
Hello,
I've encountered an issue when trying to change the host for EU data residency. The documentation suggests the following modification:
mixpanel.init( "YOUR_TOKEN", { host: "https://api-eu.mixpanel.com", }, );
This contradicts the code, where the default config is as follows:
const DEFAULT_CONFIG = { test: false, debug: false, verbose: false, host: 'api.mixpanel.com', protocol: 'https', path: '', };
And more importantly, it is incompatible with the way metrics.set_config overrides the host, as it would mess up the result of the split call:
metrics.set_config
split
metrics.set_config = function(config) { Object.assign(metrics.config, config); if (config.host) { // Split host into host and port const [host, port] = config.host.split(':'); metrics.config.host = host; if (port) { metrics.config.port = Number(port); } } };
I don't know if this is the right place to ask this, but could someone edit the documentation so that host becomes api-eu.mixpanel.com?
api-eu.mixpanel.com
Thank you for your help
Thanks for pointing out! We'll get this fixed on the documentation site.
This has been fixed. Thanks again for sharing with us!
Hello,
I've encountered an issue when trying to change the host for EU data residency. The documentation suggests the following modification:
This contradicts the code, where the default config is as follows:
And more importantly, it is incompatible with the way
metrics.set_config
overrides the host, as it would mess up the result of thesplit
call:I don't know if this is the right place to ask this, but could someone edit the documentation so that host becomes
api-eu.mixpanel.com
?Thank you for your help