Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proxy HTTP(s) Calls #312

Closed
KevinMFinch opened this issue Nov 1, 2021 · 4 comments
Closed

Proxy HTTP(s) Calls #312

KevinMFinch opened this issue Nov 1, 2021 · 4 comments

Comments

@KevinMFinch
Copy link

Is there any way to configure analytics-next to point to your own hosted proxy of the Segment API? It seems like the iOS library has this capability and I was wondering if this library has a way to do that.

@pooyaj
Copy link
Contributor

pooyaj commented Nov 1, 2021

Hi @KevinMFinch, are you using the npm package or using the version from cdn.segment.com?

@KevinMFinch
Copy link
Author

Hi @KevinMFinch, are you using the npm package or using the version from cdn.segment.com?

Hi @pooyaj currently I'm using the npm package

@pooyaj
Copy link
Contributor

pooyaj commented Nov 1, 2021

Cool, when using the npm version, you can pass the custom API host like this:

... await AnalyticsBrowser.load({ writeKey: YOUR_WRITE_KEY }, {
        integrations: {
          'Segment.io': { apiHost: "api.yourcustomurl.com/v1" },
        }
      })

@ajayjaggi97
Copy link

Hey @pooyaj .
Can we also pass the custom headers as well. We want to change the "content-type" also.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants