Tsūchi provides a framework to push notifications to third-party services. In fact, this is the ONLY way notifications are pushed out since they are more accurate than our servers ever will be.
- Ifttt (iOS, Android, Web)
The currently supported list can grow with contributions and source requests.
To make requests:
- Open an issue on Github
- Wait for someone to respond and the issue will be tagged with the
new source
tag
To make contributions:
- Open an issue on Github
- Create a pull request which references the issue you created
A service has to fulfill two categories before it can work with Tsūchi:
- It must accept POST requests (usually under the
webhooks
documentation) - These POST requests must accept an
application/json
body - You can use
application/url-encoded
, but JSON will be easier to program
An initializer function is required for the setup wizard. This grabs the user's information required for the service to work.
Here's an example of an init function for Ifttt.
Since axios is our main request handler, we will use it to send POST requests as well.
A sender function takes a user's credentials along with the MangaPacket payload and sends the POST request with these parameters.
Here's some example code on sending a POST request to Ifttt.
Since Tsūchi is in TypeScript, types are required for understanding various parts of a service. These types are for a user's credentials when creating the configuration JSON file.
Add the service types here.
Provide an optional subtype on the UserJson type which contains your service type
The main codebase requires some hooks to link to the service. A new service has to be added in both the setup wizard AND the main updater function.
Setup wizard:
- Add your service alias (in lowercase) to the possibleServices array.
- Use this service alias in the setupServices function and add a case/call to your initService function that you previously created.
Updater:
- Add your service alias from setup in the handleServices function.
- Add a case/call to your sendService function that you previously created.
Please join the Discord support server and get the king-updates
role.