Forum Academy Marketplace Showcase Pricing Features

Plugin - initialization with server-side data

Hello,

I’m probably missing something but I can’t find a way to have a plugin Element initialize itself with a server-side API call.

What I want is to provide an Element that will can trigger a server-side API call specific to the working user when it’s displayed.
I get how an app builder can do it with a Workflow, but I want to do it automatically (built-in in the plugin).

Thanks for your help !

I believe the only way is to have a separate element and server-side action or API call.

The plugin element has an event that can be triggered and then in the app, when that event triggers a workflow you have to add your API call as an action in the workflow.

Thanks for your quick answer !

Just to be sure, what you are telling me is that:
1/ my Element should have a ‘startup’ Event, that I can trigger in the ‘initialize’

function(instance, context) {
    	instance.triggerEvent('startup');
}

2/ that my server-side call has to be declare in the API Calls (as an action)

3/ that I have to explain to 100% of the people using my plugin in their app that they have to create the exact same workflow to have it work properly ? :thinking:

That doesn’t seems very… plug-and-playable

That’s the only way I know how it is possible, I agree with your point, I’ve had the exact same with my plugins, but remember that Bubble is a no-code development tool and apps still require ‘development’ using workflows etc.

Hopefully, you get it working or someone else has a better suggestion!