By using ajax we can pull the username of the player of your game. Pulling the below url with ajax will give you the players username to use in your game or even website.
https://idev.games/request/user
Below is an example of auto populating an input field in jQuery.
<html><head><scriptsrc="https://code.jquery.com/jquery-3.2.1.min.js"integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="crossorigin="anonymous"></script><script>$.ajax({url : 'https://idev.games/request/user',type : 'GET',dataType:'json',error : function(request,error){$( "#yourId" ).val(request['responseText']);}});</script></head><body><form><input id="yourId"></form></body></html>