twitter-auth

Custom n8n node to post tweets (with photos/videos) to your profile and X (Twitter) Communities using auth_token cookie authentication.

Package Information

Released: 2 mo ago
Downloads: 0 weekly / 0 monthly
Latest Version: 2.6.0

Documentation

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.

n8n
License

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)

  1. Go to Settings → Community Nodes
  2. Click Install a community node
  3. Enter: n8n-nodes-twitter-auth
  4. Click Install

Via npm

npm install n8n-nodes-twitter-auth

Then set the environment variable to load it:

export N8N_CUSTOM_EXTENSIONS="/path/to/node_modules/n8n-nodes-twitter-auth"

Setup

Getting your auth_token

  1. Open x.com in your browser and log in
  2. Open Developer Tools (F12) → Application tab → Cookies → https://x.com
  3. Find the cookie named auth_token
  4. Copy its value

Configuring in n8n

  1. Add the Twitter Auth Tweet node to your workflow
  2. Create new credentials → Twitter Auth Token API
  3. Paste your auth_token value
  4. Save

Usage

Post a Tweet (Profile)

  1. Set Operation to Criar Tweet
  2. Type your tweet text
  3. Execute

Post to a Community

  1. Set Operation to Criar Tweet
  2. Enable Postar em Comunidade
  3. Enter the Community ID (find it in the community URL: x.com/i/communities/XXXXXXXXX)
  4. Execute

Note: Community posting uses Puppeteer with bundled Chromium (downloaded automatically on install). No need to have Google Chrome installed.

Post with Media

  1. Use an HTTP Request or Read Binary File node to load your image/video
  2. Connect it to the Twitter Auth Tweet node
  3. Enable Incluir Mídia
  4. 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 CreateTweet mutation
  • 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

Discussion