How to a create a section on a panel extension only for the broadcaster?

Hey!
I am developing a simple “giveaway” extension for my streamer friend.
It will (hopefully) work like this:

  1. The viewer clicks on the apply button.
  2. My panel extension which is a React app sends the viewers’ data to an Express ebs which will save into a database.
  3. When the follower count reaches the desired number, the broadcaster can click on a button, and the ebs will randomly select a user from the database.

My question is how can I achieve that only the broadcaster sees a section on the panel view (the list of the applicants and the button that will randomly select the a user)?

I thought about I could use the Twitch Extension Helper, which has this: window.Twitch.ext.viewer.role

Is it a good idea? Or maybe is there a proper way to do that, for example if the ‘panel.html’ is for the viewers, maybe there could be an another html file only for the broadcaster?

You should put broadcaster only stuff in the config or dashboard views.

And leave all the viewer only stuff in the viewer views.

Then you have reduced the chance of leaking broadcaster control stuff to a viewer.
Otherwise yes that role parameter of the extension helper works.

Information on views: Extensions | Twitch Developers
A blog post I wrote on views (integration points): Twitch Extensions: Part 2 – Integration Points – Barry Carlyon

Thank you for the answer! I will use the dashboard view.