Skip to main content

Setup

1

Get credentials

Go to the Twitter Developer Portal and create a project and app. Under User authentication settings, enable OAuth 2.0 and set the redirect URI to:
Set the app type to Web App and enable Read permissions at minimum.
2

Configure

lib/theauth.ts

Scopes

Default scopes: users.read, tweet.read. Scopes you pass are added on top of the defaults.
Twitter does not return an email address through the standard OAuth 2.0 flow. The provider reports a synthetic non-deliverable address (username@twitter.invalid) as the email, and the oauth() plugin stores it on the user record because it matches users by email. Do not treat it as a real email.

Endpoints

Last modified on October 18, 2026