Sending SMS from the server : a Twilio and AWS SNS comparison
At my startup, PinTalk, when we decided to move away from FB Login after the Cambridge Analytica scandal, SMS Sign Up / Sign In seemed like the next best solution. Here is a walkthrough of 2 different implementations in javascript using Twilio, and AWS SNS SMS service. Both are affordable and easy to configure.
This walkthrough assumes you already have your own node.js server.
Twilio
Cost : https://www.twilio.com/sms/pricing
Note : You will need to get a phone number subscription, if you want to support several countries be careful to get a phone number with international capabilities.
- Create your Twilio account and get a phone number
- Run
yarn add twilio
- Client configuration :
3. Sending the SMS :
Amazon Simple Notification Service (SNS)
In terms of pricing SNS has no real advantage over Twilio although you don't need to buy a phone number subscription to start sending messages. For this reason I found it easier to configure and use out of the box if you already have an AWS account. We decided to make the move to AWS anyways to make the most out of our AWS credits we got from Stripe Atlas.
Cost : https://aws.amazon.com/sns/sms-pricing/
Note : No phone number subscription required. First 100 sms/month to the US are free.
- Go to https://console.aws.amazon.com/iam/home?#/users and create a new User, then "Add Permission" -> "Attach Existing Policy" -> "AmazonSNSFullAccess"
- Save your credentials somewhere safe
- Run
yarn add aws-sdk
- Client configuration :
4. Send SMS
Thanks for reading!