Back to All

Programmatic usage instead of embedded code


Is there a programmatic way to trigger Billsby UI (e.g., subscription) without relying on DOM scanning?
Storing configuration data in window and using data- attributes is ugly and error-prone when developing a Web app, say, in React.

Moreover, there is something one cannot do easily with this approach, say, tracking an analytics event when the customer clicks on the button, since the onClick handler is replaced.

For the moment, the best way is to use one's own components, which in turn trigger a synthetic onClick event on visually-hidden DOM nodes with Billsby attributes.
It would be much more natural to have a JavaScript API, which matches closely the data- attributes, and also takes the extra data as argument, instead of looking in window.

Massimo, for DoYouNotes