We currently don’t have a vanilla JavaScript example.
If you urgently need authorization using the grant_type password, take a look at these topics:
grant_type
Discussions:
Regards, Nikita