I'm not sure if I understand your question exactly, but you can write a plugin to listen to a new route (URL endpoint) or interprocess communication and load and call NodeBB libraries.
You may consider using this plugin Git repo as a bootstrap to get you started quickly. Remember that the plugin.json, package.json, and library.js are the first files to work with. The plugin repo name / directory name will need to match the glob nodebb-plugin-* and it needs to be directly under the node_modules/ directory which is at the root of your NodeBB directory.
I'll work in my research with 'late distribution'. This is a term adopted by me rs. It means that I need to split the code to work in multiple clouds. For example, the 'module' topics would be deployed in Amazon EC2 to use the load balance and the rest of nodebb code in GAE, implementing some communication between the code on the EC2 and GAE. Some ideas?
Ok, the Google ad will not show on the home page or category page, only on topic pages. Scripts from another ad provider does not work and the side will not load. The HTML widget, me thinks, should be able to render any HTML/JS script.