Tool to enable easy use of Twitter API from Firebase Cloud Function
- creation of Firebase project
- know how to use Cloud Functions for Firebase
- If you are unsure, read this
git clone https://github.com/kazuyaseki/firebase-for-twitter-api
cd firebase-for-twitter-api/functions
npm install
oryarn install
- modify setting files
- set your project name to
.firebaserc
- set your
consumer_key
andconsumer_secret
of Twitter API inside functions/index.js
- set your project name to
firebase deploy --only functions
search for the function you want from the API reference
add your function to index.js as follows. replace function name and url accordingly.
exports.your_function_name = functions.https.onRequest((request, response) => {
cors((request, response) => {
callApi(request, response, 'URL of the API you want to call');
});
});