How to create a plugin with backend API calls to populate composer while drafting?

It doesn’t seem like you need any backend changes. The behavior you describe is very similar to how our “Insert Hyperlink” modal works – you can search for topics, select one of them to add as a link, and a link will be added to the composer when you confirm.

You can add the button to a plugin outlet, or to the toolbar via a api.onToolbarCreate added to an initializer, and open a modal similarly to how we’re doing it for the “Insert Hyperlink” modal. It’s able to addText to the composer by levering the toolbarEvent object from the toolbar action (if you need an outlet, you can also interact with the composer via appEvents triggers).

3 Likes