Possibility of having files pre-installed when User Create/Add new domain

I don’t know if it’s possible to have some files pre-installed on every domain name created on CyberPanel , I have the script already coded. but i will like the script to be automatically pre-installed when user create a new domain just like the same way we have the CyberPanel shown on newly created domain.

Please note that this script also make use of the database connection so i don’t know if it’s possible.

Any suggestion will be greatly appreciated.

It will even be much better if possible via the CyberPanel API.

I’m interested in know how this works too for a new user having a website application pre-install once registered and login.