Twitter / X — Channel Overview
Researched: May 2026
Contents
- README.md — This file: overview, what to build, implementation plan
Full deferred-feature notes live at
docs/missing-incomplete-features/twitter-x-tiktok-channels.mdanddocs/missing-incomplete-features/twitter-zoho-channel-detail-pages.md.
Status
Deactivated — removed from the active channel catalogue April 2026. The ChannelMaster seed entry exists but isActive: false. Re-activating requires building the OAuth provider and publisher worker listed below.
Why This Channel
Twitter/X is still a primary real-time engagement channel for B2B tech, SaaS, local news, and crisis communication. Many clients already have an X account. It is the only platform where post timing and reply chains are as valuable as the post itself. Competitors like Hootsuite and Buffer all support X; clients notice its absence.
The API v2 free tier (tweet.read + tweet.write scopes) covers basic posting and profile reads — enough for publishing and basic analytics without a paid Twitter Developer tier.
Auth Mechanism
OAuth 2.0 with PKCE (Twitter API v2 requirement).
- Auth URL:
https://twitter.com/i/oauth2/authorize - Token URL:
https://api.twitter.com/2/oauth2/token - Scopes:
tweet.read tweet.write users.read offline.access - Token refresh: standard OAuth 2.0 refresh token flow; access tokens expire in 2 hours
The PKCE flow means no client secret is exposed on the callback. The provider package stores accessToken, refreshToken, accessTokenExpiresAt, and userId.
What It Enables
| Capability | Detail |
|---|---|
| Publishing | Text tweets up to 280 chars; thread support (multiple tweets chained); image/video attachments |
| Analytics | Impressions, engagements, likes, retweets, replies per tweet (via GET /2/tweets/:id) |
| Profile stats | Followers count, following, tweet count (GET /2/users/:id) |
| Insight worker | Tweet performance scoring; best posting time detection; thread vs single tweet comparison |
Workers Needed
| Worker | Queue | Trigger |
|---|---|---|
social-publisher.worker.ts — add case "twitter" | agent__social-publisher | SocialPost status → scheduled or client_approved |
twitter-insights.worker.ts (new) | agent__twitter-insights | Weekly, after analytics fetch |
The publisher worker is a single case addition in the existing social-publisher.worker.ts — the infrastructure is already in place.
Insight Worker Output (ChannelInsight)
- Top performing tweets by engagement rate
- Follower growth over 30 days
- Best posting days / hours
- Thread vs single post performance comparison
- Suggested: next tweet topic based on top engagers’ interests
Implementation Plan
Phase 1 — Connect + Publish
-
Create
packages/providers/twitter/src/index.ts:getAuthUrl(callbackUrl, channelId)— PKCE challenge + stateexchangeCode(code, verifier, callbackUrl)— returns tokens +userIdrefreshAccessToken(refreshToken)— returns new access tokenpostTweet(accessToken, text, mediaIds?)—POST /2/tweetsgetUserProfile(accessToken, userId)—GET /2/users/:id
-
Add OAuth routes to
apps/api/src/routers/channel-connect.ts:GET /twitter/connect— generate PKCE challenge, store verifier in session, return auth URLGET /twitter/callback— exchange code, store tokens, redirect to close
-
Add
case "twitter"tosocial-publisher.worker.ts -
Re-activate seed entry in
packages/db/prisma/seed.ts -
Create
apps/dashboard/src/app/(dashboard)/channels/[id]/TwitterXChannelDetail.tsx
Phase 2 — Analytics + Insights
-
Create
packages/providers/twitter/src/analytics.ts:getTweetMetrics(accessToken, tweetIds[])— batch metrics fetchgetFollowerCount(accessToken, userId)— profile stats
-
Create
packages/agents/src/workers/insights/twitter-insights.worker.ts -
Add Insights + Suggestions tabs to
TwitterXChannelDetail.tsx
Seed Entry
// packages/db/prisma/seed.ts — CHANNEL_CATALOGUE
{
type: "Twitter",
name: "Twitter / X",
iconKey: "x",
description: "Post to Twitter/X and track engagement metrics.",
authenticationType: "oauth2",
requiresUrl: false,
isActive: true, // change from false
categories: ["social_media"],
},Related
docs/missing-incomplete-features/twitter-x-tiktok-channels.mddocs/missing-incomplete-features/twitter-zoho-channel-detail-pages.mdpackages/agents/src/workers/social-publisher.worker.ts