Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implementing a client-side WebHook handler?

Tags:

I am a bit of a newbie in Webhooks, so excuse me if this is a simple question.

I am clear about how Webhook providers work, i.e. whenever this information needing to be pushed, it sends the payload to the URL specified as callback.

Now my question is: how do I write a client-side Webhook handler, that can detect/process the callback and update my client-side accordingly. For example, if my client-side is a simple web-page with bullet-points, I would like to append new data to the list, whenever it comes through.

Preferably, I would be after a complete JavaScript solution...

Is there perhaps a JS WebHook Client/Handler that already exists? It seems that this should be so common, that it should exist, although I haven't been able to find anything.

like image 263
Sweety Avatar asked Sep 06 '12 17:09

Sweety


People also ask

How do I create a webhook client?

You can install webhooks on an organization or on a specific repository. To set up a webhook, go to the settings page of your repository or organization. From there, click Webhooks, then Add webhook. Alternatively, you can choose to build and manage a webhook through the Webhooks API.

What is a webhook handler?

It is a simple server to server communication for reporting a specific event occurred on a server. The server on which event occurred will fire a HTTP POST request to another server on a URL which is provided by receiving server.


1 Answers

Take a look at WebSockets. Depending on your needs, this could be exactly what you need to avoid polling and keep things in sync - particularly if you have a lots of clients who need to see the same updates from your server.

I highly recommend Socket.IO

like image 169
matthewhudson Avatar answered Sep 18 '22 10:09

matthewhudson