How to integrate mapplic with vanilla javascript

I am trying to integrate mapplic.js where I want to fetch my custom api data, and use them in mapplic map.
But I am having trouble with it’s some functions like “setState, getState, fetchData” and so on.
Please help me with fetching the data and setting them.

Thanks!

I tried with jquery after investigating some solution online. But those didn’t worked.
I want to use it with vanilla Javascript.