Coder Social home page Coder Social logo

tharari21 / conversations-demo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from twiliodeved/conversations-demo

0.0 0.0 0.0 1.97 MB

Demo chat app for use in Conversations Quickstart, with updated UI.

JavaScript 82.47% CSS 13.41% HTML 4.12%

conversations-demo's Introduction

The Demo Conversations App

This is a lightweight application based on Twilio Conversations.

Please follow the directions for the Twilio Conversations Quickstart for a complete demo of this application with both SMS and chat participants.

Configuring and getting started

This demo requires a Twilio account and a working Conversations Service SID. You'll need to collect some credentials from the Twilio Console:

  • Your Account SID (ACXXX) and Auth Token, both accessible from the Dashboard
  • Your Account's Conversations Service Sid ISXXX SID which is attached to your Conversations Service

Testing

The demo application can be configured and run in two ways:

  • Forking the demo-conversations-application on CodeSandbox.io (recommended)
  • Cloning this repo and running locally
    • Remember to copy the .env.example file to .env and replace the variables values with the ones from your account. By default NODE_ENV is set to production.

Replacing the Access Token

The Conversations API uses an Access Token with a Chat Grant for client-side applications such as this one to authenticate themselves with Conversations Services in your Twilio Account.

In order for your Conversations Application to work, we need to authenticate a Conversations user by retrieving a short-lived token attached to your API Key. The getToken function in ConversationsApp.js has a placeholder for your chat token.

You can generate a token in a few ways:

For the twilio-cli option, run the following command and enter the resulting token into the placeholder:

twilio token:chat --identity <The test chat username> --chat-service-sid <ISXXX...>

After generating a token manually, it will expire after a timeout period, so you will need to replace the token. To use this in production software, you would typically create a token endpoint in your back end application that uses your existing user authentication strategy.

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.