Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save evanwinter/b92667f1b9ede79eaca1f7855aa8d461 to your computer and use it in GitHub Desktop.
Save evanwinter/b92667f1b9ede79eaca1f7855aa8d461 to your computer and use it in GitHub Desktop.
Send an SMS text message using the Twilio API and Node.js SDK.
const twilio = require("twilio")
const accountSid = "<MY_TWILIO_ACCOUNT_SID>"
const authToken = "<MY_TWILIO_AUTH_TOKEN>"
const client = new twilio(accountSid, authToken)
client.messages.create({
body: "Hello from Node.js",
to: "<TARGET_PHONE_NUMBER>",
from: "<MY_TWILIO_PHONE_NUMBER>"
}).then((message) => console.log(message.sid))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment