Skip to content

An example of a Google Cloud Function that uses Twitter API SDK to manage tweets.

Notifications You must be signed in to change notification settings

wlemahieu/typescript-twitter-api-google-cloud-function

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Twitter API Connected Google Cloud Function

Connect to Twitter API through a Cloud Secrets API key in order to manage Tweets.

Cloud Account Prerequisites:

General Knowledge Prerequisites:

Local Tool Recommendations:

  • VSCode
  • NPX (npm install -g npx)
  • NVM (or a similar node manager)

To test a GCF locally:

  1. nvm use 16 - Switch to Node 16 (nvm install 16.5.1 if not installed)
  2. npm install - Install all node_modules for the GCF
  3. TWITTER_BEARER_TOKEN= npm run watch - Serve the example GCF locally
  4. http://localhost:8080/ - Visit the locally served GCF
*A note on easily moving ready components from local to the cloud:

After cloning this repository, you can upload a zip of the example GCF directory directly to a created Cloud Function. Alternatively, you can manually create & copy GCF files and their contents into your created Cloud Function.

Twitter Developer Sign-up required!

In order to use the Twitter API SDK, you'll need to sign-up to the Twitter developer portal and create a Bearer token & access tokens. Those should be stored in Google Cloud Secrets as TWITTER_BEARER_TOKEN, TWITTER_CLIENT_ID, TWITTER_CLIENT_SECRET

About

An example of a Google Cloud Function that uses Twitter API SDK to manage tweets.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published