To solve 3rd party script issues we want to proxy our own api.segment.io calls
We're ok having it on the same fqdn and routing back w/ nginx/cloudflare/cloudfront/etc.
But it looks like .send() does not give us an opportunity to put in send it as the same
originating domain.
would love for SEGMENT_API_HOST/apiHost just take "/v1", "/segment/v1"
const apiHost = settings?.apiHost ?? SEGMENT_API_HOST
const protocol = settings?.protocol ?? 'https'
const remote = `${protocol}://${apiHost}`
....
return client
.dispatch(
`${remote}/${path}`,
normalize(analytics, json, settings, integrations)
)
.then(() => ctx)