GithubHelp home page GithubHelp logo

frontline-serverless-callbacks-aws-codepipeline's Introduction

Frontline Integration Service Example

This repository contains an example server-side web application that is required to use Twilio Frontline.

It creates the following routes that you will then need to add to your Twilio Frontline Console:

  • /callbacks/crm
  • /callbacks/outgoing-conversation
  • /callbacks/templates
  • /callbacks/routing
  • /callbacks/twilio-conversations

Detailed information can be found in the Node.js Quickstart.

Prerequisites

How to start development service

# install dependencies
yarn

# copy environment variables
cp .env.example .env

# run service
yarn run start

Environment variables

# Service variables
PORT # default 5001

# Twilio account variables
TWILIO_ACCOUNT_SID=ACXXX...
TWILIO_AUTH_TOKEN

# Variables for chat configuration
TWILIO_SMS_NUMBER # Twilio number for incoming/outgoing SMS
TWILIO_WHATSAPP_NUMBER # Twilio number for incoming/outgoing Whatsapp

Setting up customers and mapping

The customer data can be configured in src/providers/customers.js.

Map between customer address + worker identity pair.

For inbound routing: Used to determine to which worker a new conversation with a particular customer should be routed to.

{
    customerAddress: workerIdentity
}

Example:

const customersToWorkersMap = {
    'whatsapp:+87654321': '[email protected]'
}

Customers list

In the CRM callback reponse, each customer object should look like this:

Example:

const customers = [
    {
        customer_id: 98, // required
        display_name: 'Bobby Shaftoe', // required
        worker: '[email protected]', // required
        channels: [
            { type: 'email', value: '[email protected]' },
            { type: 'sms', value: '+123456789' },
            { type: 'whatsapp', value: 'whatsapp:+123456789' }
        ],
        links: [
            { type: 'Facebook', value: 'https://facebook.com', display_name: 'Social Media Profile' }
        ],
    },
    //... more customer objects
];

Response format:

objects: {
    customers: customers
}

Troubleshooting

Port issues

If you experience issues running the Node.js server on port 5001, you can use any other free port.

You can add PORT=xxxx to the .env.

Alternatively, you can edit it here. Note that the one from the .env file will override the one on src/config.js.

frontline-serverless-callbacks-aws-codepipeline's People

Contributors

alfrol avatar askel4dd avatar cancit avatar dependabot[bot] avatar florantara avatar kpavlov avatar louisptremblay avatar thomasphorton avatar yrananavare 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.