I wanna build a embeddable widget using preact that is able to take a screenshot of a part of the page where it is embedded.
I tried using html-to-image but i can't figure out how to use it for my usecase. Somehow i need to expose a function that is avalible to the global window object so the use can select the area and make the screenshot of it.
It would be great to get some hints how to achive this.