Is it possible to integrate JavaScript and Kibana?

Have you considered developing a custom visualization plugin for Kibana? It sounds like you want access to the Kibana context, but more control than Vega. That is what the plugin system is for.