Skip to Content
ChannelsTwitter XTwitter / X — Channel Overview

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.md and docs/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

CapabilityDetail
PublishingText tweets up to 280 chars; thread support (multiple tweets chained); image/video attachments
AnalyticsImpressions, engagements, likes, retweets, replies per tweet (via GET /2/tweets/:id)
Profile statsFollowers count, following, tweet count (GET /2/users/:id)
Insight workerTweet performance scoring; best posting time detection; thread vs single tweet comparison

Workers Needed

WorkerQueueTrigger
social-publisher.worker.ts — add case "twitter"agent__social-publisherSocialPost status → scheduled or client_approved
twitter-insights.worker.ts (new)agent__twitter-insightsWeekly, 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

  1. Create packages/providers/twitter/src/index.ts:

    • getAuthUrl(callbackUrl, channelId) — PKCE challenge + state
    • exchangeCode(code, verifier, callbackUrl) — returns tokens + userId
    • refreshAccessToken(refreshToken) — returns new access token
    • postTweet(accessToken, text, mediaIds?)POST /2/tweets
    • getUserProfile(accessToken, userId)GET /2/users/:id
  2. Add OAuth routes to apps/api/src/routers/channel-connect.ts:

    • GET /twitter/connect — generate PKCE challenge, store verifier in session, return auth URL
    • GET /twitter/callback — exchange code, store tokens, redirect to close
  3. Add case "twitter" to social-publisher.worker.ts

  4. Re-activate seed entry in packages/db/prisma/seed.ts

  5. Create apps/dashboard/src/app/(dashboard)/channels/[id]/TwitterXChannelDetail.tsx

Phase 2 — Analytics + Insights

  1. Create packages/providers/twitter/src/analytics.ts:

    • getTweetMetrics(accessToken, tweetIds[]) — batch metrics fetch
    • getFollowerCount(accessToken, userId) — profile stats
  2. Create packages/agents/src/workers/insights/twitter-insights.worker.ts

  3. 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"], },

  • docs/missing-incomplete-features/twitter-x-tiktok-channels.md
  • docs/missing-incomplete-features/twitter-zoho-channel-detail-pages.md
  • packages/agents/src/workers/social-publisher.worker.ts

© 2026 Leadmetrics — Internal use only