Get User's IP Address Without Relying on Plugin?

Can it be done? I want to capture my user’s IP addresses when they sign the terms of use.

Are we trying to solve the right problem here?

Hi redvivi, I am not sure of the intent of your question; please clarify.

Not sure if it will work so you’ll just have to try it:

Make a backend workflow, change it to “Detect request data”, check the box for “Include headers” then do “Detect data”

Setup an API call in another tab to that backend workflow (with /initialize at the end) with no headers and check the box to do it directly from browser.

Initialize the API call

Then go to the backend workflow and add the “Return data from API” action, and return the connecting-ip and country if you want.

Then reinitialize so the API call knows it will be receiving those values

Since it has to be as Data you can just use that as the data source for when you are logging the IP address

2 Likes

This is by far the best work around. Especially since the Ipify plugin is no longer, and the replacements do not work properly.

On a side note though, in order to get the correct IP, the API call must call direct to your domain, rather than the Bubble App domain, otherwise you get a pass through IP, and not the actual user IP. This is why I think the new get IP plug ins are not working properly.

It’s either this method or pay bookoos for an iffy plug in.

Shouldn’t be too hard to make a plugin element to do the API call instead to confirm it doesn’t come from server side API connector, with some info on how to setup the backend workflow :thinking:

It probably needs to be made from the client. That means no private keys, or shared headers. Just set up a new API call group and make a simple POST request to your own backend workflow that returns the user’s IP. Make sure you check ‘attempt to make call from client’s browser’