Skip to content

X (Twitter) Setup

Configure X (Twitter) integration through the Twitter Developer Portal.

Prerequisites

  • Twitter Developer Account
  • Project with appropriate access tier
  • OAuth 2.0 with PKCE enabled

Access Tiers

X offers different API access tiers with varying capabilities:

TierCostTweet Posts/MonthRead Tweets/Month
Free$01,5000
Basic$100/mo3,00010,000
Pro$5,000/mo300,0001,000,000
EnterpriseCustomCustomCustom

IMPORTANT

For production use with multiple users, Basic tier is the minimum recommended.

Required Scopes (OAuth 2.0)

ScopePurpose
tweet.readRead tweets
tweet.writePost tweets
users.readRead user info
offline.accessRefresh tokens (required for long-lived access)

Optional Scopes

ScopePurpose
dm.readRead DMs
dm.writeSend DMs
follows.readRead following/followers
like.readRead likes
like.writeLike tweets

Callback URL

https://api.tendsocial.com/api/social/accounts/callback/twitter

Set in: Developer Portal → Your App → User authentication settings → Callback URI

Environment Variables

bash
TWITTER_CLIENT_ID=your_client_id
TWITTER_CLIENT_SECRET=your_client_secret

OAuth 2.0 with PKCE

X requires PKCE (Proof Key for Code Exchange) for OAuth 2.0:

  1. Generate code_verifier (random 43-128 character string)
  2. Create code_challenge = BASE64URL(SHA256(code_verifier))
  3. Include code_challenge and code_challenge_method=S256 in auth URL
  4. Include code_verifier when exchanging code for tokens

TendSocial handles this automatically via the Twitter adapter.

Platform Limitations

FeatureStatus
Text tweets✅ Supported (280 chars, or 25,000 for Premium)
Images✅ Up to 4 images per tweet
Videos✅ Supported
Polls❌ Not available via API
Threads✅ Supported (reply to own tweet)
Scheduled tweets❌ Not available via API (use TendSocial scheduler)
DMs⚠️ Requires elevated access
Analytics⚠️ Limited in lower tiers

App Permissions Configuration

In Developer Portal → Your App → User authentication settings:

  • App permissions: Read and write
  • Type of App: Web App
  • Callback URI: Your callback URL
  • Website URL: Your app's website

TendSocial Documentation