# \[ANNOUNCE\] node-red-contrib-webhookrelay

**URL:** <https://discourse.nodered.org/t/announce-node-red-contrib-webhookrelay/5989>\
**Category:** Share Your Nodes\
**Created:** [20 December 2018 14:29 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-webhookrelay/5989 "2018-12-20T14:29:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rusenask](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rusenask/32/4580_2.png) [@rusenask](https://discourse.nodered.org/u/rusenask)\
**Post date:** [20 December 2018 14:29 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-webhookrelay/5989/1 "2018-12-20T14:29:09Z")

</div>

Hello, I am creator of [Webhook Relay](https://webhookrelay.com) and a big fan of Node-RED. I would like to present a general purpose webhook receiving node `node-red-contrib-webhookrelay` which can help you receive & process webhooks from 3rd party providers such as Google Home actions, GitHub, Gitlab and so on without having a public IP/domain or configuring NAT/firewall. The only requirement is an internet connection.

## How it works

Node `node-red-contrib-webhookrelay` works by creating a websocket to [webhookrelay.com](http://webhookrelay.com) public servers and waits for the incoming webhooks. All users can create **buckets** that can have one or more endpoint URLs (we call them **inputs** ) such as `https://my.webhookrelay.com/v1/webhooks/<your ID>`. Node can subscribe to one or all of your buckets and receive data about HTTP requests.

## Motivation

While running Node-RED on both my RPI and desktop, I really don't want to configure NAT to expose it to the internet when I am working on something new. As I have recently added WebSocket support to the service, I thought it would be a good opportunity to write a small wrapper to make my configuration easier.

## Example usage

First, go to [https://my.webhookrelay.com/](https://my.webhookrelay.com/) and either login (Google & GitHub OAuth or regular username and password) or register. Don't worry about marketing emails, never tried sending them and not planning to start.

### Install node

Node is named as `node-red-contrib-webhookrelay` and as of now is published & tagged:

 ![node-red-install-webhookrelay](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/b/b39ca104cdfad7b3a8ff90c7584550d6089f5903.png)

Now, we will need two things from webhook relay:

1. Bucket from [https://my.webhookrelay.com/buckets](https://my.webhookrelay.com/buckets). You can name buckets based on either what they are receiving or what will be subscribing to them. Let's call our bucket **nodered**. Also, bucket should have a 'default public endpoint' which is exactly what it says it is. Your public URL that you can point webhooks at:

 ![node-red-webhookrelay-bucket](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/d/ddfb8137815ffa9e9d69e077e5c1b6dc51cbbe24.png)

1. Token key & secret from [https://my.webhookrelay.com/tokens](https://my.webhookrelay.com/tokens) page.

Once you have both token & bucket, add them to the node:

 ![node-red-configure-node](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/7/7c4e4b6d46e098d8b8b1c3858676edf94b788c3f.png)

### Test it

You can attach a debug node to Webhook Relay node and test it by sending a webhook to your public input URL:

 ![node-red-webhook-received](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/2X/5/5b51fc92092bb230a4056e163d4d2324614ec7e5.png)

Payload will have two fields:

- topic - which is bucket name
- payload - actual JSON object with all request information:

```json
{
	"topic": "nodered",
	"payload": {
		"type": "webhook",
		"meta": {
			"bucked_id": "12302faf-43bd-43c4-ab1d-89a8b0505693",
			"bucket_name": "nodered",
			"input_id": "544a6fe8-83fe-4361-a264-0fd486e1665d",
			"input_name": "Default public endpoint",
			"output_name": "",
			"output_destination": ""
		},
		"headers": {
			"Content-Type": ["application/json"],
			"Accept": ["*/*"],
			"Content-Length": ["29"],
			"User-Agent": ["insomnia/6.3.2"],
			"Cookie": ["__cfduid=dc244a014f0b1e2965544ddb483c3fe1b1525866866"]
		},
		"query": "",
		"body": "{\n\t\"msg\": \"hello Node-RED!\"\n}",
		"method": "PUT"
	},
	"_msgid": "eb4a7330.c838b"
}

```

### Libraries used:

- [https://github.com/webhookrelay/webhookrelay-ws-client](https://github.com/webhookrelay/webhookrelay-ws-client)
- [https://github.com/webhookrelay/node-red-contrib-webhookrelay](https://github.com/webhookrelay/node-red-contrib-webhookrelay)

### Free tier & pricing

Webhook Relay has a **free** tier of up to 150 webhooks per month. Which is not a lot but enough for a lot of people. Basic tier is **$4.5/m** and gives you 1500 webhooks. Please consider subscribing to a paid tier to support the project.

If you would like to use more but cannot afford to pay, feel free to ping me either on Webhook Relay portal chat, email or here with PM and we can arrange something.

### Privacy & Security

Since this node doesn't provide bidirectional traffic and is pretty much only good for 3rd party integrations, traffic is encrypted from any outside users but webhooks are stored in the webhook relay database for the amount of days your plan allows. This makes debugging easy as you can inspect and resend webhooks. Only you can access your webhook data.

However, if you are going to send something really secret, I would suggest using webhookrelay CLI agent with TLS pass-through tunnels: [https://webhookrelay.com/v1/guide/tls-tunnels.html](https://webhookrelay.com/v1/guide/tls-tunnels.html). It shields traffic from the Webhook Relay servers and they just route encrypted data through the tunnels. With this method, we couldn't spy on you even if we were forced to.

### Issues and requests

If you encounter any issues or requests, either submit them here or on the github repo here [https://github.com/webhookrelay/node-red-contrib-webhookrelay](https://github.com/webhookrelay/node-red-contrib-webhookrelay)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [15 February 2019 16:17 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-webhookrelay/5989/2 "2019-02-15T16:17:06Z")

</div>

Just opened an issue in GitHub - the node crashed Node-RED with an uncaught exception - see [https://github.com/webhookrelay/node-red-contrib-webhookrelay/issues/2](https://github.com/webhookrelay/node-red-contrib-webhookrelay/issues/2)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [20 February 2019 12:11 UTC](https://discourse.nodered.org/t/announce-node-red-contrib-webhookrelay/5989/3 "2019-02-20T12:11:10Z")

</div>

@rusenask fixed the issue - very responsive!!
