n8n-nodes-twitter-auth
v2.6.0
Published
Custom n8n node to post tweets (with photos/videos) to your profile and X (Twitter) Communities using auth_token cookie authentication.
Maintainers
Readme
n8n-nodes-twitter-auth
Custom n8n community node to interact with X (Twitter) using auth_token cookie authentication. Post tweets with media to your profile and Communities — no official API keys required.
Features
| Feature | Method | Description | |---------|--------|-------------| | Post to Profile | GraphQL API | Fast, direct tweet creation via internal API | | Post to Community | Browser (Puppeteer) | Navigates to community page and posts via UI | | Upload Photos | Chunked Upload API | JPEG, PNG, WebP, GIF support | | Upload Videos | Chunked Upload API | MP4 with automatic processing wait | | Like Tweet | GraphQL API | Like any tweet by ID | | Retweet | GraphQL API | Retweet any tweet by ID | | Follow / Unfollow | REST API | Follow or unfollow users by ID | | Account Info | GraphQL API | Get authenticated account details |
Installation
Via n8n UI (Recommended)
- Go to Settings → Community Nodes
- Click Install a community node
- Enter:
n8n-nodes-twitter-auth - Click Install
Via npm
npm install n8n-nodes-twitter-authThen set the environment variable to load it:
export N8N_CUSTOM_EXTENSIONS="/path/to/node_modules/n8n-nodes-twitter-auth"Setup
Getting your auth_token
- Open x.com in your browser and log in
- Open Developer Tools (
F12) → Application tab → Cookies →https://x.com - Find the cookie named
auth_token - Copy its value
Configuring in n8n
- Add the Twitter Auth Tweet node to your workflow
- Create new credentials → Twitter Auth Token API
- Paste your
auth_tokenvalue - Save
Usage
Post a Tweet (Profile)
- Set Operation to Criar Tweet
- Type your tweet text
- Execute
Post to a Community
- Set Operation to Criar Tweet
- Enable Postar em Comunidade
- Enter the Community ID (find it in the community URL:
x.com/i/communities/XXXXXXXXX) - Execute
Note: Community posting uses Puppeteer with bundled Chromium (downloaded automatically on install). No need to have Google Chrome installed.
Post with Media
- Use an HTTP Request or Read Binary File node to load your image/video
- Connect it to the Twitter Auth Tweet node
- Enable Incluir Mídia
- Set the Binary Property Name (default:
data). For multiple files, separate with commas:photo1,photo2
Supported formats: JPEG, PNG, WebP, GIF, MP4
Limits: Up to 4 images or 1 video per tweet.
Requirements
- n8n v1.0.0 or later
- Valid X (Twitter)
auth_token - Chromium is bundled automatically — no need to install Chrome
How It Works
This node uses Twitter's internal GraphQL API (the same one the website uses) with cookie-based authentication. No official API keys or developer account needed.
- Profile tweets: Direct GraphQL
CreateTweetmutation - Community tweets: Puppeteer with bundled Chromium navigates to the community page and posts through the UI, since the API ignores
community_id - Media upload: Chunked upload to
upload.twitter.com(INIT → APPEND → FINALIZE → STATUS) - Session management: Each execution creates a fresh session with full cookie collection to avoid rate limiting
License
MIT
