Frappe.ui.form.on(doctype) on main webpage

Instead of using an api, I am wondering if using basically the backend js file would work on a web page?

Has anyone done it and where do you put the js file? I know the www folder. I mostly want to see if anyone has done it.

  1. What are the security implications of doing this. I do not intend for everyone to see it but only serious customers.