analytics-react-native
analytics-react-native copied to clipboard
Modifying the headers before callling fetch
I am using a proxy to redirect my traffic before going to api.segment.io. My proxy has some special header requirements, so I want to modify the headers before the fetch call.
I am considering making a local modification which allows a modifyHeaders function to be passed into the analytics-react-native module, and that function could be called after the headers have been constructed and before fetch is called.
Before I do that I was hoping someone could tell me if there is already a way of doing this, or if there is a better design
Hi @ndpmurphy
Right now this is not implemented. If you want to made the changes and create a pull request, you can take a look here: https://github.com/neiker/analytics-react-native/blob/master/src/index.js#L220