This repository demonstrates how to send notifications over SMS, WhatsApp, Voice (calls), and Email.
This project was bootstrapped with Create React App. Then an Express server was added in the server
directory. The server is proxied via the proxy
key in package.json
.
To send messages with WhatsApp in production, you have to wait for WhatsApp to formally approve your account. But, that doesn't mean you have to wait to start building. Twilio Sandbox for WhatsApp lets you test your app in a developer environment.
Clone the project, change into the directory and install the dependencies.
git clone https://github.com/jonedavis/twilio-saasmart-demo.git
cd twilio-saasmart-demo
npm install
Create a .env
file for environment variables in the root directory of this project.
Example:
TWILIO_ACCOUNT_SID=ACCOUNT_SID_HERE
TWILIO_AUTH_TOKEN=AUTH_TOKEN_HERE
SENDGRID_API_KEY=API_KEY_HERE
Read the blog post How To Set Environment Variables to learn more.
You can start the server on its own with the command:
npm run server
Run the React application on its own with the command:
npm start
Run both applications together with the command:
npm run dev
The React application will run on port 3000 and the server port 3002.