Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

wercker status codecov


Gambit is the API for SMS conversations:

  • Receives inbound messages, creates/updates users and/or campaign activity, and sends an outbound reply

  • Sends outbound broadcast messages

  • Sends outbound confirmation messages for web subscriptions and/or campaign signups

  • Updates user subscription status when outbound message delivery fails

  • Sends outbound support messages from agents


Gambit receives and sends SMS messages from/to users via Twilio, forwarded from our internal message broker. It queries GraphQL to source outbound message content.

Staff members can chat with Gambit in Slack to test conversations, and can view Gambit content and conversation data from an internal web app.

Gambit forwards support requests from users into a Front inbox, where agents are able to send messages back to provide support.


Gambit is built with:


Local Node, redis, and MongoDB installations are required to run this application. (More detailed installation instructions here).

  • Install Node, Redis and MongoDB.
  • Clone this repo and navigate to it.
  • Create a .env file with required variables. See .env.example for guidance. (Some detailed instruction here).
  • Your local Node.js and NPM versions should match the ones in package.json.
  • Install dependencies: npm install.
  • All tests should pass: npm run test:full.
  • Run Gambit Conversations locally: npm start (uses nodemon).


With Gambit running locally, test Gambit replies by opening a new terminal window and running:

  • nvm use && node shell.
PuppetSloth-MacBook-Pro-2:gambit puppetsloth$ node shell

 ██████╗  █████╗ ███╗   ███╗██████╗ ██╗████████╗
██╔════╝ ██╔══██╗████╗ ████║██╔══██╗██║╚══██╔══╝
██║  ███╗███████║██╔████╔██║██████╔╝██║   ██║
██║   ██║██╔══██║██║╚██╔╝██║██╔══██╗██║   ██║
╚██████╔╝██║  ██║██║ ╚═╝ ██║██████╔╝██║   ██║
 ╚═════╝ ╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝   ╚═╝


* To send a photo, type 'photo'.
* To retry last message, type 'retry'.


Input is posted to your localhost api/v2/messages?origin=twilio endpoint on behalf of the Northstar User with mobile number matching your DS_CONSOLEBOT_USER_MOBILE config variable. A new Northstar User is created for the mobile number if it doesn't exist.


  • Run npm test:full to lint code and run automated tests.
  • Pull Requests are expected to contain reasonable test coverage.

Note: Git tags exist from when we used Wunderflow for branching. We now adhere to a Github flow, keeping consistent with workflow for other current DoSomething repositories, and no longer create tags for each deployment.


I get an ERR! cb() never called! error when running npm install.

I ran into this error when upgrading npm from 5.x to 6.x. There seems to be a bug that affects apps w/ a lot of dependencies. Here's the Link

Steps I took to fix it:

  • Raised the maxfiles and maxproc system limits, Link.
  • Exit out of all terminals and re-open.
  • Removed node_modules and package-lock.json.
  • Run npm install again.
You can’t perform that action at this time.