Kerrick Long’s

Web Log & Articles

GitHabit - GitHub webhooks ♥ HabitRPG!

I wrote an open source node.js application to tie your Github contributions with your HabitRPG account. Stay motivated to contribute to open source with GitHabit!

How to use GitHabit

Install GitHabit

First, you’ll need to set up your node server. Check out the GitHub repository for GitHabit. The README has more information on how to get started!

Build the payload URL

Get your GitHabit API Token and User ID on HabitRPG -> ⚙ -> API, then fill them in below to build your payload URL. You’ll use this payload URL later to set up GitHabit.

[YOUR_SERVER_URL]?user=[YOUR_USER_ID]&api=[YOUR_API_TOKEN]

Set up webhooks

Next set up your webhooks; please note that you will have to do this once for each repository you want to have GitHabit track.

  1. Go to Settings for a GitHub repository you control Screenshot of Step 1
  2. Click Webhooks & Services
  3. Click Add webhook Screenshot of Steps 2, 3
  4. Use the Payload URL from above.
  5. If you wish, you can customize which events will level you up. By default, Just the push event is a good choice.
  6. Be sure that the Active checkbox is checked.
  7. Click Add webhook and you’ll be set up! Screenshot of Steps 4, 5, 6, 7

The first time GitHabit receives an event from GitHub, it will create the GitHub habit for you. You may then edit the habit as you would any other. Now your open source contributions will level up your GitHub habit on HabitRPG!

GitHabit for Developers

If you would like to contribute, check out the GitHub repository for GitHabit. The README has more information on how to get started, and issues and pull requests are welcome!

320 words