{"id":37826591,"url":"https://github.com/webhookrelay/webhookrelay-ws-client","last_synced_at":"2026-01-16T15:45:54.008Z","repository":{"id":91909805,"uuid":"162122667","full_name":"webhookrelay/webhookrelay-ws-client","owner":"webhookrelay","description":"Receive webhooks without having public IP/web server or configuring NAT/firewall","archived":false,"fork":false,"pushed_at":"2020-02-29T22:19:03.000Z","size":27,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-02T07:48:14.500Z","etag":null,"topics":["iot","iot-gateway","webhook","websocket"],"latest_commit_sha":null,"homepage":"https://webhookrelay.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/webhookrelay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-17T11:48:49.000Z","updated_at":"2025-04-21T15:41:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e6b61961-dcb6-4199-afea-49740b20e246","html_url":"https://github.com/webhookrelay/webhookrelay-ws-client","commit_stats":{"total_commits":32,"total_committers":1,"mean_commits":32.0,"dds":0.0,"last_synced_commit":"d69ca42290ce4293e5f7f8714ae9324255ce4c98"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/webhookrelay/webhookrelay-ws-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webhookrelay%2Fwebhookrelay-ws-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webhookrelay%2Fwebhookrelay-ws-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webhookrelay%2Fwebhookrelay-ws-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webhookrelay%2Fwebhookrelay-ws-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webhookrelay","download_url":"https://codeload.github.com/webhookrelay/webhookrelay-ws-client/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webhookrelay%2Fwebhookrelay-ws-client/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28479409,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["iot","iot-gateway","webhook","websocket"],"created_at":"2026-01-16T15:45:53.803Z","updated_at":"2026-01-16T15:45:53.911Z","avatar_url":"https://github.com/webhookrelay.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://webhookrelay.com\" target=\"_blank\"\u003e\u003cimg width=\"100\"src=\"https://webhookrelay.com/images/sat_logo.png\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n[![Build Status](https://drone-kr.webrelay.io/api/badges/webhookrelay/webhookrelay-ws-client/status.svg)](https://drone-kr.webrelay.io/webhookrelay/webhookrelay-ws-client)\n\n## Problem\n\nUbiquitous HTTP protocol allows any application to talk to any other application over the network. However, sometimes applications are behind firewalls, routers that don't do NAT, or just don't have an HTTP server at all. In this case applications would have to do HTTP polling that is slower and more resource intensive task.\n\n## Solution\n\n Webhook Relay WebSocket client allows applications to receive webhooks without public IP, configuring NAT/firewall or even having a web server in the first place. It does this by creating a WebSocket connection to Webhook Relay public SaaS: https://webhookrelay.com/v1/guide/. Each user gets their public HTTP endpoints where they can configure routing (other public endpoints, [relayd agents](https://webhookrelay.com/download/), or WebSocket clients) \n\n## Installation\n\n```\nnpm i webhookrelay-ws-client\n```\n\n## Usage\n\nTo start using this library:\n\n1. Retrieve your tokens from [Webhook Relay tokens page](https://my.webhookrelay.com/tokens). You will need to supply them to the library.\n2. [Create a bucket](https://my.webhookrelay.com/buckets) called 'nodered' and check what input URL did you get (should be something like: `https://my.webhookrelay.com/v1/webhooks/...`). Input URL will be your own inbox that you can supply to any other application to send webhooks or any other HTTP requests to.\n3. Import into your application:\n\n```javascript\nvar ws = require(`webhookrelay-ws-client`);\n\n// handler function has to accept a JSON string and parse on its own\nvar handler = function (data) {\n    console.log(data)\n}\n\n// create a client with specified token key and secret from https://my.webhookrelay.com/tokens and any buckets that\n// can be created here https://my.webhookrelay.com/buckets. Handler function is called whenever there's a new message\nvar client = new ws.WebhookRelayClient('your-token-key', 'your-token-secret', ['bucket-1', 'bucket-2'], handler)\n\n// connect starts a websocket connection to Webhook Relay \nclient.connect();\n```\n\n### Example application\n\nSet tokens as environment variables:\n\n```bash\nexport RELAY_KEY=[YOUR TOKEN KEY]\nexport RELAY_SECRET=[YOUR TOKEN SECRET]\n```\n\n```javascript\n// app.js\nvar ws = require(`webhookrelay-ws-client`);\n\nvar apiKey = process.env.RELAY_KEY;\nvar apiSecret = process.env.RELAY_SECRET;\n\nvar handler = function (data) {\n    console.log(data)\n}\n\nvar run = function () {    \n    var client = new ws.WebhookRelayClient(apiKey, apiSecret, ['nodered'], handler)\n    client.connect();\n\n    // do some work\n\n    // disconnect whenever connection is no longer needed\n    setTimeout(function(){ \n        console.log('disconnecting')\n        client.disconnect();\n    }, 10000);\n}\n\nrun();\n```\n\nTo run it:\n\n```bash\nnode app.js\n```\n\nNow, whenever you send webhooks to your public endpoint `https://my.webhookrelay.com/v1/webhooks/\u003cyour input ID\u003e`, they will be received inside your application. You can subscribe to multiple buckets. Each message will have a JSON string that you can parse:\n\n```javascript\n{\n  \"type\": \"webhook\",             // event type\n  \"meta\": {                      // bucket, input and output information \n    \"bucked_id\": \"1593fe5f-45f9-45cc-ba23-675fdc7c1638\", \n    \"bucket_name\": \"my-1-bucket-name\",                                \n    \"input_id\": \"b90f2fe9-621d-4290-9e74-edd5b61325dd\",\n    \"input_name\": \"Default public endpoint\",\n    \"output_name\": \"111\",\n\t\t\"output_destination\": \"http://localhost:8080\"\n  },\n  \"headers\": {                   // request headers\n    \"Content-Type\": [\n      \"application/json\"\n    ]\n  },\n  \"query\": \"foo=bar\",            // query (ie: /some-path?foo=bar)\n  \"body\": \"{\\\"hi\\\": \\\"there\\\"}\", // request body\n  \"method\": \"PUT\"                // request method\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebhookrelay%2Fwebhookrelay-ws-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebhookrelay%2Fwebhookrelay-ws-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebhookrelay%2Fwebhookrelay-ws-client/lists"}