How to create a custom icon in the toolbar with a custom event?

Hi,
How can I create a custom icon in the toolbar with a custom event attached to it?
I’m using the iFrame API in my application.
Can I do something like this:

api.addEventListener('copyLink', function(){
            // some code here
        });

But then how can I add an icon and attach this custom ‘copyLink’ event to it?

1 Like