module.exports = defineComponent({
props: {
twitter_developer_app: {
type: "app",
app: "twitter_developer_app",
}
},
async run({steps, $}) {
const Twit = require('twit')
const { api_key, api_secret_key, access_token, access_token_secret } = this.twitter_developer_app.$auth
const T = new Twit({
consumer_key: api_key,
consumer_secret: api_secret_key,
access_token,
access_token_secret,
timeout_ms: 60 * 1000, // optional HTTP request timeout to apply to all requests.
strictSSL: true, // optional - requires SSL certificates to be valid.
})
return await T.get('account/verify_credentials', { skip_status: true })
},
})
Twitter Developer App uses API keys for authentication. When you connect your Twitter Developer App account, Pipedream securely stores the keys so you can easily authenticate to Twitter Developer App APIs in both code and no-code steps.
Video Tutorial on how to create and connect a Twitter Developer App to Pipedream
First, you'll need to sign up for a Twitter developer account and create a new application in the Twitter app dashboard.
api_key
and api_secret_key
into a Twitter Developer App Account on Pipedreamaccess_token
and access_token_secret
in the Twitter Developer App Account on PipedreamOnce you've created an app, visit the Keys and tokens section of the app's settings, and add the API key, API secret key, Access token, and Access token secret below.