Client supports three X API v2 auth modes:
- Bearer Token (app-only): Public read, search, and streaming endpoints.
- OAuth 2.0 PKCE (user context): Scoped user actions (creating posts, bookmarks, DMs, X Chat) with refresh tokens.
- OAuth 1.0a (user context): HMAC-SHA1 request signing.
Bearer Token
OAuth 2.0 with PKCE
Register a redirect URI (for example,http://localhost:8080/callback) on your app in the Developer Console, then run the PKCE flow with OAuth2PKCEAuth: