This is an example of sending SMS using React and Twilio. It consists of a SMSForm
component that communicates with a server endpoint to send SMS messages via the Twilio REST API.
To see how to build the project yourself, check out the blog post How to send an SMS from React with Twilio.
This project was created from the react-express-starter project and includes a React front end and an Express server.
To run the project you will need a Twilio account and a Twilio phone number that can send SMS messages. Gather your Twilio Account Sid and Auth Token from the Twilio console and the phone number.
Then, clone the project, change into the directory and install the dependencies.
git clone https://github.com/philnash/send-sms-react-twilio.git
cd send-sms-react-twilio
npm install
Copy the .env.example
file to .env
and fill in your Twilio credentials and phone number.
Start the application on its own with the command:
npm run dev
Open the app at localhost:3000. You can now use the form to send SMS messages via your Twilio number.