With this integration you can perform actions on Twitter from Js.
Credential configuration
To configure this credential you need the Bearer token from one Twitter app. You can find it on
Twitter developer portal, selecting the app (or creating one) and go to Keys and tokens
tab.
You'll find the bearer token inside Authentication tokens
section.
Optionally you can set in the JSON field some request options which are common to all requests.
Here you have an example of a filled credential configuration form in YepCode:

Twitter snippets available in editor
Explore the full Twitter API docs in: https://developer.twitter.com/en/docs/twitter-api
The title is the triggering text for YepCode to autocomplete the script
Integration
const twitter = yepcode.integration.twitter('credential-slug');
const { Client } = require("twitter-api-sdk");
const twitter = new Client('bearer-token')
Search recent tweets
const searchRecentTweetsResponse = await twitter.tweets.tweetsRecentSearch({
query: "the-search-query", // Example: from:yepcode_io
"tweet.fields": ["author_id", "text"],
expansions: ["author_id"],
});
searchRecentTweetsResponse.data.forEach(console.log);
See how to build a query in: https://developer.twitter.com/en/docs/twitter-api/tweets/search/integrate/build-a-query#examples
Get user tweets
const userTweetsResponse = await twitter.tweets.usersIdTweets("user-id");
userTweetsResponse.data.forEach(console.log);
Get tweet by id
const getTweetResponse = await twitter.tweets.findTweetById("tweet-id");
console.log(getTweetResponse.data);
Find users by username
const findUsersByUsernameResponse = await twitter.users.findUsersByUsername({
usernames: ["username1"],
"user.fields": "id,name,username,description,verified",
});
findUsersByUsernameResponse.data.forEach(console.log);
Find users by id
const findUsersByIdResponse = await twitter.users.findUsersById({
ids: ["id1"],
"user.fields": "id,name,username,description,verified",
});
findUsersByIdResponse.data.forEach(console.log);
Get followers
const getFollowersResponse = await twitter.users.usersIdFollowers("user-id");
getFollowersResponse.data.forEach(console.log)