8 – How to edit the drupalSettings JavaScript in an event?

I have a subscriber to a UserLogin event. I want this subscriber to produce a marketing tracking variable to Javascript, but I do not see how I could do this because Event Subscriber is a class that implements only an interface, but does not have access to Drupal. square brackets, like:

function lotus_preprocess_html (& amp; variables) {
$ lotus_height = & # 39; 300px & # 39;
// Add a JS library
$ variables['#attached']['library'][]    = "Lotus / lotus-js";
$ variables['#attached']['drupalSettings']['lotus']['lotusJS']['lotus_height']    = $ lotus_height;
}