🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@robinpath/twitter

Package Overview
Dependencies
Maintainers
4
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@robinpath/twitter

X (Twitter) v2 API integration — post and delete tweets, search, look up users, follow/unfollow. Uses the encrypted credential vault for OAuth 2.0 user-context access tokens.

latest
npmnpm
Version
0.3.0
Version published
Weekly downloads
21
50%
Maintainers
4
Weekly downloads
 
Created
Source

@robinpath/twitter

Twitter/X module for RobinPath.

Category Functions Auth License

Why use this module?

The twitter module lets you:

  • Create a new tweet
  • Delete a tweet by ID
  • Get a single tweet by ID with optional expansions and fields
  • Get multiple tweets by IDs
  • Get tweets from a user's timeline

All functions are callable directly from RobinPath scripts with a simple, consistent API.

Installation

robinpath add @robinpath/twitter

Quick Start

1. Set up credentials

twitter.setToken "AAAA...your-bearer-token"

2. Create a new tweet

twitter.createTweet "Hello from RobinPath!"

Available Functions

FunctionDescription
twitter.setTokenStore a Bearer token for X/Twitter API v2 authentication
twitter.createTweetCreate a new tweet
twitter.deleteTweetDelete a tweet by ID
twitter.getTweetGet a single tweet by ID with optional expansions and fields
twitter.getTweetsGet multiple tweets by IDs
twitter.getUserTimelineGet tweets from a user's timeline
twitter.getMentionsGet tweets mentioning a user
twitter.searchRecentSearch recent tweets (last 7 days) with a query
twitter.getUserGet a user by username
twitter.getUserByIdGet a user by their ID
twitter.getMeGet the authenticated user's profile
twitter.getFollowersGet followers of a user
twitter.getFollowingGet users that a user is following
twitter.followFollow a user (uses authenticated user as source)
twitter.unfollowUnfollow a user
twitter.likeLike a tweet (uses authenticated user)
twitter.unlikeUnlike a tweet (uses authenticated user)
twitter.getLikedTweetsGet tweets liked by a user
twitter.retweetRetweet a tweet (uses authenticated user)
twitter.unretweetUndo a retweet (uses authenticated user)
twitter.getRetweetersGet users who retweeted a tweet
twitter.bookmarkBookmark a tweet (uses authenticated user)
twitter.removeBookmarkRemove a bookmarked tweet (uses authenticated user)
twitter.getBookmarksGet the authenticated user's bookmarked tweets
twitter.createListCreate a new list
twitter.deleteListDelete a list
twitter.addListMemberAdd a user to a list
twitter.removeListMemberRemove a user from a list
twitter.getListTweetsGet tweets from a list
twitter.sendDmSend a direct message to a user
twitter.getDmEventsGet direct message events

Examples

Create a new tweet

twitter.createTweet "Hello from RobinPath!"

Delete a tweet by ID

twitter.deleteTweet "1234567890"

Get a single tweet by ID with optional expansions and fields

twitter.getTweet "1234567890" {"tweet.fields": "created_at,public_metrics"}

Integration with RobinPath

import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/twitter";

const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);

const result = await rp.executeScript(`
  twitter.setToken "AAAA...your-bearer-token"
  twitter.createTweet "Hello from RobinPath!"
`);

Full API Reference

See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.

License

MIT

Keywords

twitter

FAQs

Package last updated on 06 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts