How to add javascript snippet into my app?

I think you could just write a .js file with the javascript code you want to run and import it using grasia-dash-components library.
Read this message for more: Append script when dash components are loaded.