The Fastest way to start using Twilio with Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

#Twilio HackPack for Heroku and Sinatra An easy-to-use repo to kickstart your Twilio app using Sinatra and deploy onto Heroku. This is a Ruby port of Rob Spectre's Twilio Hackpack for Python, so check that out if you don't like Ruby (what's wrong with you!?)

##Features: What this can do for you!

  • Automatic Configuration - running configure.rb will help you set up your whole Twilio/Sinatra/Heroku app environment!
  • Local Development Easy - bundle install will help you get any necessary gems
  • Hackable - easy to read code and easy to modify all in app.rb
  • Twilio Client - Want to call something from your browser? Gotcha covered!
  • Testing - working on those... not ready yet

##Usage: The hackpack contains endpoints for Twilio Voice and SMS apps. Check out how to edit the '/voice' and '/sms' routes in app.rb

Say an app that plays some Kooks:

post '/voice/?' do
  response = do |r|
    r.Play ""

Or an app that will tell you how sweet this hackpack is:

post '/sms/?' do
  respose = do |r|
    r.Sms "This Hackpack is pretty sweet!"

All regular Twilio, TwiML, and Ruby logic applies, and to get a better understanding on how to use the Twilio Ruby gem, check it out here

##Installation: Step-by-step on how to deploy, configure, and develop using this hackpack.

###Getting Started

  1. Grab latest source:
git clone git://
  1. Navigate to folder and create a Heroku Cedar stack:
heroku create --stack cedar
  1. Configure your Twilio information: Check out the Configuration section below

  2. Deploy to Heroku:

git push heroku master
  1. Check out your new app!
heroku open

###Configuration You can use this hackpack with a ton of configurable options whether you have a Twilio number, application id, or not. To get a feel for what can happen, take a look at:

ruby configure.rb -h

####Automatic Configuration You'll first want to run bundle install to obtain the required Ruby gems to get this hackpack up and running. Other than that, the hackpack itself can do anything from buying you a new Twilio phone number, creating a new application, or configuring your account SID and auth token.

  1. At the beginning, run:
ruby configure.rb --sid ACXXXXXXX --token YYYYYYYY
  1. For local development, copy and paste the commands the configure script provides
export TWILIO_ACCOUNT_SID=ACxxxxxxxxxxxxxx
export TWILIO_AUTH_TOKEN=yyyyyyyyyyyyyyyyy
export TWILIO_APP_SID=APzzzzzzzzzzzzzzzzzz
export TWILIO_CALLER_ID=+15556667777
  1. Launch webserver:
foreman start
  1. Tweak away on app.rb

##Questions: If you have any questions/suggestions/feedback, email me at


  • Tests...
  • Modify app template for easier changes or adding of pages