Open gesposito opened 2 years ago
@gesposito are you referring to adding the protocol at the start? I believe we do not enforce having a path value of 2/httpapi
for the url.
I'm more concerned about the path part, and if it is ever going to change, I wasn't able to complete requests without adding it
Oh i see what you mean here. So you are proxying the requests through www.custom.url
, right? So for the old (amplitude-js) where apiEndpoint
is used, the endpoint has a path of /
hence configuring the sdk does only requires the domain. While this new SDK, consumes an entirely new endpoint that has a path of /2/httpapi
, which proxied request should have too. I wouldn't be concerned about this path getting deprecated, since we still have two other (older) ingestion endpoints that we support today.
However, i believe there are areas to improve here on the developer experience side. I'll take this feedback to the team and see how we can make managing the path more seamless.
cc @qingzhuozhen
Oh i see what you mean here. So you are proxying the requests through
www.custom.url
, right? So for the old (amplitude-js) whereapiEndpoint
is used, the endpoint has a path of/
hence configuring the sdk does only requires the domain. While this new SDK, consumes an entirely new endpoint that has a path of/2/httpapi
, which proxied request should have too. I wouldn't be concerned about this path getting deprecated, since we still have two other (older) ingestion endpoints that we support today.
Correct
However, i believe there are areas to improve here on the developer experience side. I'll take this feedback to the team and see how we can make managing the path more seamless.
cc @qingzhuozhen
Thanks!
I'm using Cloudfront to proxy to amplitude server. It works after I added endpoint path like this:
amplitude.init('<token>', {
serverUrl: 'https://xxxxxxxxxxxxxxxxxxxxxxx.cloudfront.net/2/httpapi',
})
I was doing something like:
// This not work!
amplitude.init('<token>', {
serverUrl: 'https://xxxxxxxxxxxxxxxxxxxxxxx.cloudfront.net',
})
serverUrl
isn't documented, or hard to find docs for http2 api via Proxy. Hope this helps someone.
Summary
For proxied requests I was previously using this setup
while now it looks like I need to do something like this
is this the new intended behaviour? Is this going to change in the future?