first create your plugin of type process.
Then on page 0 press the button Create => "Page control on this page" on the right hand-side of the top-bar.
Choose Process and on the following screen choose Plug-ins and select you plug-in.
Follow the steps of the wizard to complete the process.
I created the page process on page 0, but when I want to call it nothing happens.
If I add the same page process on page 1 it works.
I don't think that the problem is code-related. I tried with pl/sql-process - on load before header
you could of course use a condition of REQUEST=... and combine this, when you only want the process to run on some pages, with the conditions "Current Page..."
Another option would be to use an Authorization Scheme with some smart logic regarding the REQUEST and Current Page (APP_PAGE_ID)
I use the plugin "(IR) Report to Excel (xlsx)" which I found in APEX-PLUGIN.com I did some adaptations to do the output on multiple sheets.
I expanded the action menu of interactive reports by the point "Download to xlsx" (dynamic action on page 0).
Everthing works great if I include the plugin on a page. The only problem is, as described above, that I don't want to include the plugin manually on every page.
Now I try, as proposed, to put the code into a package but by now I wasn't successful.