☕️ Basic Twilio Barista implementation for blog post
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
src
twilio-functions
.gitignore
README.md
package-lock.json
package.json

README.md

Twilio Barista Lite

This is a basic version of Twilio Barista to explain the basic concept.

Requirements

Setup

1. Download and install dependencies

git clone https://github.com/dkundel/barista-lite.git
cd barista-lite
npm install

2. Install Twilio Functions

a) Create a Twilio Sync Service and copy the SID

b) Configure the following variables in your Twilio Functions section:

  • Enable ACCOUNT_SID and AUTH_TOKEN
  • Set API_KEY and API_SECRET to a valid pair. You can generate them in the Twilio Console
  • Set SERVICE_SID to the SID of your Sync Service
  • Set PHONE_NUMBER to the phone number or Messaging Service SID that you want to use to send notification SMS

c) Create three Twilio functions out of the three files in the twilio-functions folder

d) Configure the Function in your Studio flow to point against the create-sync-item function and make sure it passes trigger.message.From as phoneNumber and trigger.message.Body as order.

e) Set the webhook URL of your Sync Service to the URL of your sync-update-handler function

f) Copy the URL of your barista-token URL and place it in the src/data/orders.js file as the tokenUrl variable.

3. Start the React dev server

Start the application by running:

npm start

4. Start sending and receiving your orders and seeing them in the browser

5. ☕️

Contributors

  • Dominik Kundel

License

MIT