How to extend webhooks and API touchpoints

Is it possible to extend out-of-the box webhooks with set of hooks, monitoring user logins and or requests against static pages.
I’m interested monitoring logins of users or members to the system or their behaviour at certain static pages.

Where in /core/server do you define webhooks and touchpoints for API?

Any help is much appreciated!

I’ll start with a warning :warning: Defining custom webhook events is not a feature supported out of the box in Ghost and if you modify /core/server you are left on your own to maintain the changes compatible with the upstream :point_up:

Now to the possible solution :slight_smile: You can find a list of supported webhook events here. These events usually come from model layer and can be overriden/enhanced in the model itself..

So, if you are looking to add a custom event you’d (1) emit it like this from the place of interest, (2) would make sure webhooks listen for that event and (3) your webhook has that event name set as it’s event property in the database (because there’s no UI to set custom event listeners, which you might wanna (4*) modify here in Ghost-Admin.

Hopefully this is enough guidance for you to figure out the rest. Good luck!

@Naz: Thank you!
Will give it a try.