You can integrate the Spontit API with GitHub webhooks to send push notifications when an update to the repository is made.
For a video on how to do so, see here.
For instructions on how to do so, see the steps below.
We use the function in get_github_webhook_body.py
on our server to generate the body of the notification.
If you use the Spontit API and want us to format the body differently, or improve the way we format the body and generate the description, simply create a pull request or issue and we'll review it. If it all checks out, we'll test it and update our server.
We GREATLY appreciate all additions.
To set up GitHub push notifications, see the steps below.
- Go to the repository you want notifications for. Go to "Settings". Go to "Webhooks". Click "Add Webook".
- Sign up for Spontit at spontit.com. Get the mobile app. Make sure notifications are turned on for both the website and the mobile app. Send a test notification and make sure it goes through. If you have any trouble, email [email protected].
- Go to the channel on Spontit that you want notifications sent to. You can view a list of your channels at spontit.com/push. At that link, you can also create a channel.
- Get the link of the channel you want to send your pushes to. You can get this link by selecting the channel on the "Push" tab and then selecting "View". Say your username is fruits. The link for your main channel is spontit.com/fruits. If you create a channel called "Apple", then the link for that channel is called spontit.com/fruits/apple.
- For the payload URL, enter https://api.spontit.com/webhooks/github/{channel_id} where channel_id is either fruits or fruits/apple, depending on the channel you chose (see Step #4). You can create an unlimited number of channels. Thus, if you chose the channel available at spontit.com/fruits/apple, then the final link would be https://api.spontit.com/webhooks/github/fruits/apple, for example. If you chose the channel available at spontit.com/fruits (i.e. your main channel), then the final link would be https://api.spontit.com/webhooks/github/fruits.
- Make sure "Content Type" is "application/json".
- For the secret, go to spontit.com/secret_keys and get a secret key. Copy and paste that key into the "Secret" box.
- Enable SSL, select "Just the push event", check "Active", and click "Update Webhook". You should immediately get a notification on your devices. Sometimes Android phones might take a few minutes.
- Invite others to your channel and to Spontit using the link in step #4!
If you have any trouble, please do not hesitate to reach out at [email protected]. We highly recommend watching the video tutorial here.