Barcode (qr) scanner

I was thinking of doing it via an HTML iFrame. I looked for some examples online, but they are all using additional JS files. I tried to put them in the backend, but I don’t understand how to import them from the backend into the iFrame.