If user runs your game using the itch app, it sets the environment variable
ITCHIO_API_KEY which can be used with server-side API, provided that you added .itch.toml manifest file with proper scope attribute - the link also includes an example of using
/api/1/jwt/me endpoint for getting the user info.
If user does not use itch app, it becomes more complicated. The game can use itch OAuth for authentication, but that would require redirecting user to browser (or using some sort of embedded browser).