With this post, I’ll be offering a different perspective on the issue of “returning” data from the backend to the frontend. I’ll be describing an entirely different approach - one which uses neither the API Connector nor App Connector and has the following benefits:
- Simpler to implement
- Easier to maintain
- More secure
What makes this approach possible is a (lesser known and underutilized) client-side action called Trigger a custom event when data changes which does exactly what the name suggests. It’s a bit like a “database trigger” for the frontend.
The basic idea is that instead of explicitly and synchronously returning data to the frontend by calling a public API endpoint, an event-driven asynchronous approach is used wherein Bubble “watches” specific data and then “notifies” the frontend when that data changes. A client-side workflow can then take relevant action based on the changed data. Following is an example to illustrate this approach.
Log In As Another User
It’s not uncommon to want to allow privileged users (such as admins) to log in as another user for the purpose of troubleshooting and providing support.
One approach to implementing this functionality is described in this other forum thread and makes use of the App Connector; but that method is fraught with issues relating to complexity, maintainability, and security that are inherent to that approach. The following method instead uses only workflows and privacy rules without publicly exposing any endpoints.
Basic User Experience
To implement this, we must enable one user to visit the magic login link created for a different user. Sounds simple enough conceptually, and in fact, it’s pretty straightforward in practice.
To achieve this, we’ll need to store the generated login link somewhere accessible only to the user who’ll be logging in (the admin in this case). To keep things simple for this example, we’ll store it directly on the User data type and set privacy rules accordingly - i.e. only the user can view it; everyone else cannot. (I named the field LIA Link. “LIA” stands for “Log In As”.)
Outline of Events
- Admin clicks a button to log in as another user.
- The workflow for that click event does two things:
- Tells Bubble to start watching the current user’s (admin’s) LIA Link field. (This is done via the Trigger a custom event when data changes action mentioned above.)
- Schedules a backend workflow which generates the login link and saves it to the admin’s LIA Link field.
- Bubble detects the changed field (because of step 2.1 above) and triggers our client-side custom event.
- The client-side custom event simply visits the link and logs the user in.
Frontend - Button Click - Step 1
Frontend - Button Click - Step 2
Frontend - Custom Event
Backend - API Workflow - Step 1
Backend - API Workflow - Step 2
That’s it. No plugins involved. No API calls to manage. No security-related challenges. Instead, we embrace and work with Bubble’s security model (privacy rules) for a solution that’s clean, simple, and secure.
Additional Notes
-
Any WU consumption beyond that of an API call due to the DB write(s) is well worth it IMO for the simplicity and security.
-
A long-standing issue with the frontend trigger action was recently resolved (in fact, I was notified of the fix by Bubble support just yesterday), so I’ll be using the action even more now that it no longer leaks resources.

-
This post is not meant to suggest there aren’t legitimate use cases for making API calls to your own app - just that many (if not most) “return data” scenarios might benefit from a rethinking. By shifting from a synchronous or “procedural” mindset to a more asynchronous or “event-driven” mode of thought, a Bubble dev will reap many benefits down the road.
-
Instead of weighing down the User type with extra fields (which might be used infrequently), consider using a separate data type. I call mine Watch Data. That way, it can be loaded only on pages where it’s actually needed. Just be sure to carefully configure the privacy rules.
-
Finally, I wanted to note that there’s also a way to accomplish this by using only Bubble’s real-time notification mechanism. The frontend trigger action highlighted in this post makes things even more convenient though.




