Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

axios jwt

const token = process.env["TWITTER_BEARER_TOKEN"]

const fetchTweetsFromUser = async (screenName, count) => {
  const response = await fetch(
    `https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=${screenName}&count=${count}`,
    {
      headers: {
        Authorization: `Bearer ${token}`,
      },
    }
  )
  const json = await response.json()
  return json
}
Source by copilot.github.com #
 
PREVIOUS NEXT
Tagged: #axios #jwt
ADD COMMENT
Topic
Name
3+3 =