Trying to mimic an IDP flow using a non SAML or OpenID connect compliant

Hello, we have a legacy login which we will eventually fully replace with okta user management.

Meanwhile we created an API so that the UI will display the correct form for the user to login.

On the js form I can pre-set the username, but the widget is initialized when the angular 1.x controller.
In other words, I can’t set the username on the widget on initializing, only after an action has been performed on the page.

Is there a way for me to do so on the Widget?

I’ve tried document.findElement().value = username, but the widget form is not happy with that