Twitter OAuth not returning email despite proper configuration
I'm using better-auth with Twitter OAuth and can't get the email address from users. I've set up everything according to docs but still getting:
What I've done:
- Enabled "Request email from users" in Twitter dev portal
- Set up app as "Web App" with "Confidential client"
- Set callback URL to
http://localhost:3000/api/auth/callback/twitter
- Been following this guide: https://www.better-auth.com/docs/authentication/twitter
Current code:
What I'm getting:
No email in the profile data. How can I get Twitter to return the email address with better-auth? Is this a Twitter API limitation or a configuration issue?
Any help appreciated!Twitter (X) | Better Auth
Twitter provider setup and usage.
12 Replies
Can you please make sure this consent screen appear when you try to signin

I'm having trouble with this right now as well..
I'm logging the data coming back and it does indeed include email..
It's included in the scope and it's in the profile data.. yet it says it isnt there
Calling
linkSocial
like this
my twitter account has an email linked to it.. not sure
I guess for context.. I'm logged into my app via credentials and linking twitter to it
I have been successful in this but trying to grab the email now and it's not working ..got it working somehow
`
here you are getting the email right ?
@KiNFiSH Yes it's logging the email.. but
email: profile.email
is throwing an email not found errorYou mean data.email ?
Internally we do covert it from confirmed_email response to email literal
how, I don't get anything
I need to fetch it separately in getUserinfo
We fetch for you and merge with the response data
but I was also in version 1.1.10 - just upgraded to 1.2.7
Yeah you should update
lots of things are red now, but I'll hope it'll fix some things 😄
Yeah. It should be working
Lemme know if that’s not the case