Giter Site home page Giter Site logo

twilio_google-sheets's Introduction

#UPDATE There is an issue where the log does not always begin from column A. It is fixe with this update. More info https://www.twilio.com/code-exchange/log-incoming-text-messages-in-google-sheets

Google Sheets

Logs incoming SMS numbers and messages into a Google Sheets spreadsheet.

Pre-requisites

To use this function, you will need a Google Sheets spreadsheet you want to log messages into, and a Google Cloud service account and associated authentication key. See the Google documentation on creating a service account and generating an authentication key for details. Ensure that your authentication key is in JSON format, and that it is saved to a file named auth.private.json under the assets directory for this function.

Environment variables

This project requires some environment variables to be set. To keep your tokens and secrets secure, make sure to not commit the .env file in git. When setting up the project with twilio serverless:init ... the Twilio CLI will create a .gitignore file that excludes .env from the version history.

In your .env file, set the following values:

Variable Description Required
GOOGLE_CREDENTIALS The path to your Google service account authentication JSON file Yes
DOCUMENT_ID The document ID for your Google Sheets spreadsheet Yes
SHEET_NAME The spreadsheet name to log to within your Google Sheets document Yes

Create a new project with the template

  1. Install the Twilio CLI
  2. Install the serverless toolkit
twilio plugins:install @twilio-labs/plugin-serverless
  1. Initiate a new project
twilio serverless:init example --template=google-sheets && cd example
  1. Start the server with the Twilio CLI:
twilio serverless:start
  1. Open the web page at https://localhost:3000/index.html and follow the instructions to test your application.

ℹī¸ Check the developer console and terminal for any errors, make sure you've set your environment variables.

Deploying

Deploy your functions and assets with either of the following commands. Note: you must run these commands from inside your project folder. More details in the docs.

With the Twilio CLI:

twilio serverless:deploy

twilio_google-sheets's People

Contributors

korayertan avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.