I use the Twitch API in my web application to allow users to link their Twitch account. I've been able to successfully pull user info such as username and email address from 30+ users.
But I had a user try to link their account and it crashed because their email address (associated with Twitch, pulled from the Twitch API users endpoint) was undefined, and I was expecting it to be a string.
I didn't know one could create a Twitch account without using an email address. How could this user not have one? I did find this: https://www.reddit.com/r/Twitch/comments/7xzmf9/twitch_account_with_no_email_assoicated/
So maybe this user created a Twitch account initially through Amazon, and the API is not able to see their Amazon associated email address? Anyone have any experience with this? Should this be reported to Twitch as an issue/bug?
I have added code to account for users with no address. Turns out it is possible (at time of this answer) to have a Twitch account without an email address.