Submit 'ipAddress' form variable w/ Hubspot API via ReactJS



I’ve been able to use 99% of the Hubspot API’s “submit data to form” Nodejs example code with our website (built in Reactjs), except for the ipAddress data. I’ve figured out how to translate everything into react-acceptable code, except for that one variable. I keep getting an “req is undefined” error when I try to use it as is in the API doc example. Does anyone have any ideas for how to get this to work with React?

For the record, the rest of the data sends when I comment out the ipAddress variable (and all information shows in Hubspot as proper form submissions), but we don’t have any analytics information without the ipAddress.