Not able to use "app" or "app1" in external gui

I am very new to natron but I am trying to bring it in as a precomp comp software for our lighting team.
The issue I am having is that I cannot use app.createnode or app1.createNode. I am getting an error that app does not exist.
I built a qt app that I am launching from menu. I see in the example initGui.p code that all of their qt code is inside that file. Does my app need to be written completley inside the or can I pass the “app” object to my gui?