How to make dui callbacks

i was wondering if making callbacks, from the dui to the client was possible.
i was trying to get some data from the dui through it’s javascript, with fetch, i create and render.
if it is, how?

thank you.