[New Feature] Make API call directly in the browser, if possible

Hi, thanks for reporting this. Do you mind sharing screenshots of the API, API call and configuration you are trying with?

thanks for the quick response-- I sent you a message with more details

1 Like

Hi @renatoasse so one thing I should clarify is that any API requests made from the editor. Such as the one made to initialize the API will still go through the server.

That said, there seems to be a bug elsewhere such that this feature does not work properly on some APIs. But this specific case you raised is working properly

Is there any chance that while this was rolled out it might have broken some other calls? I created a new API this AM and itā€™s borked. When I recreate a new one with the same URL/body, it seems to be running fine.

Hmm seems unlikely. If you still have troubles with it Iā€™d recommend you submit a Bug Report | Bubble

Hi everyone, it seems like there were some issues yesterday with this feature not working with some APIs. We have made a change and we believe the issues should now be fixed but let me know if you see anything weird.

Also, just to clarify, checking that box does not guarantee that an API call will be made by the client. It will just try to do so when possible. For example, any API calls done from the editor, such as the call to initialize an API will go through Bubble. Any calls that happen as part of an Action will also go through Bubble. Any calls that change user data will go through Bubble.

3 Likes

This is correct. The reason is mainly that there is some technical complexity relating to CORS to be able to do this with headers and decided to leave that out of the scope of the feature for now.

1 Like

Ah ok, thanks for telling us!
On calls going through Bubble, so only calls used as data sources would go through the browser?

1 Like

Yes, basically

1 Like

@gerry98 Just to further clarify, if I use a workflow action with a client-side API enabled, let say saving a picture through the API (PUT action), the call would happen server-side?

Correct

Hey @gerry98

I donĀ“t see the feature in any of my apps. IĀ“ve submitted a bug report but I donĀ“t know if itĀ“s something I have to do to see the feature.

1 Like

Same, I was looking for the option as well and itā€™s not available. @gerry98

1 Like

@ryanck @eli
Thanks both for reporting this. I am working on a fix but it may not go out until Monday. In the mean time you can work around this by changing the authentication to anything and then changing it back to None or Self-Handled.

Also make sure that the call meets all the required conditions such as having not private headers or params.

2 Likes

Would the new ability to call APIā€™s direct from the browser allow for HIPAA compliance if we were to use an external HIPAA compliant database seeing that this information is now not passing through the backend?

You can only get data client side, so if you have a repeating group you can display data with a client side API but as soon as you manipulate the data and save it, that happens server side. I believe that negates the possibility of HIPAA compliance.

Ah right so you can only call the info not pass it back.

I heard some one say that they had created client side plugins that could retrieve data. Would it be possible to create a client side plug-in that sends the data. I would assume that if you can do a GET you could do a POST

We would be intending to store all data in the HIPAA database and none at all besides perhaps USER in the bubble db

Thanks @gerry98, that worked!

Hello @gerry98

That did work for me.

Can anyone point us to when will be a best use case for using this feature instead of going through Bubble servers directly?

I cannot picture how can this is better than the server one. I understand as @nocodeventure said that, this does not impact in BubbleĀ“s server work load but I would love to know a case so I can understand better.

Thanks a lot and have a good Sunday to all :).

Yes, speed! You may get instant results from the API instead of them taking 2 seconds to load. By instant I mean 0.2 second, which is instant to the human eye.
Another one: Save app capacity. If it goes through the browser, then it doesnā€™t uses the appā€™s capacity.

And thatā€™s more than enough to move requests to client side :yum:

It has a pretty limited usage condition now, but if in the future it supports more types of requests, then it will be a pretty powerful tool.

3 Likes