cskonopka / WebSMS

Example of how to use a web button to send sms using Twilio, React, Node & axios

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

twilioWebSMS

What?

This is a basic example of how to set up a webpage using React and creating a button that will post to the NodeJS apiusing axios which will then send a sms using the twilio api.

Instructions

  1. Install dependencies

     `npm i install`
    
  2. In the file app.js, add your creditionals and the number that is sending the sms to this block of code

     `var twilioCreds = { 
     	"accountSid": "accountSid", 
     	"authToken": "authToken", 
     	"number": "YOUR_TWILIO_NUMBER_HERE" 
     }`
    
  3. Start the frontend

     `npm run start`
    
  4. In a separate terminal start the server

     `hotnode app.js`
    

How to Use

  1. Navigate to the webpage and add a US number + area code that will receive the sms, i.e. 9785355355 [+1 is automatically added]
  2. Press the "Send SMS" button and the specified number will pop up in the webpage

About

Example of how to use a web button to send sms using Twilio, React, Node & axios


Languages

Language:JavaScript 77.5%Language:HTML 15.3%Language:CSS 7.1%