onEvent callback, it will be called for every event available on the widget. The callback should be defined as follows:
onEvent definition example
eventName is a string that states the event that triggered the callback, and the metadata attribute is an object containing relevant information about the event that triggered the callback. It may be possible for some of the metadata attributes to be null.