How to use Jira issue view background script

How to use Jira issue view background script in Forge app. Where to place backgroundscript.js file, is it in static files folder? Can some one provide some example for this with Custom UI option?

Thanks,
Mahesh