amplitude / Amplitude-TypeScript

TypeScript Amplitude Analytics SDK
https://amplitude.github.io/Amplitude-TypeScript/
MIT License
142 stars 40 forks source link

How to set a proxy #128

Closed davidbergso closed 2 years ago

davidbergso commented 2 years ago

Summary

The "apiEndpoint" option does not appear to be working for setting a proxy. Is there a new way to do this with the typescript SDK?

dnshi commented 2 years ago

Hi @davidbergso thanks for submitting this question.

To set a proxy, you can set the option serverUrl when you initialize amplitude.

amplitude.init('API_KEY', 'USER_ID', { serverUrl: "proxy url" });
otaviojacobi commented 2 years ago

Hello, thanks for the response on this. Just a question, is there any reason why in the typescript API it is called serverUrl and in the JS one it is apiEndpoint? It seems a bit inconsistent.

kevinpagtakhan commented 2 years ago

Hi @otaviojacobi! It was renamed to be consistent with all other SDKs across all other platforms we support. We have a migration guide here: https://www.docs.developers.amplitude.com/data/sdks/typescript-browser/migration/ if you are moving to @amplitude/analytics-browser from amplitude-js.

otaviojacobi commented 2 years ago

Hello @kevinpagtakhan thanks a lot!