{"id":18625469,"url":"https://github.com/domapic/webhook-domapic-module","last_synced_at":"2025-10-26T22:09:12.334Z","repository":{"id":98609775,"uuid":"160961889","full_name":"domapic/webhook-domapic-module","owner":"domapic","description":"Domapic module for triggering a webhook","archived":false,"fork":false,"pushed_at":"2019-01-06T11:40:06.000Z","size":244,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T06:09:04.849Z","etag":null,"topics":["domapic","domotic","iot","request","rest-api","webhook"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/domapic.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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-08T17:20:33.000Z","updated_at":"2020-12-21T18:30:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"34d93053-9330-4c15-9252-5c51349277b9","html_url":"https://github.com/domapic/webhook-domapic-module","commit_stats":null,"previous_names":["javierbrea/webhook-domapic-module"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fwebhook-domapic-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fwebhook-domapic-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fwebhook-domapic-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/domapic%2Fwebhook-domapic-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/domapic","download_url":"https://codeload.github.com/domapic/webhook-domapic-module/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239418578,"owners_count":19635208,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["domapic","domotic","iot","request","rest-api","webhook"],"created_at":"2024-11-07T04:34:37.387Z","updated_at":"2025-10-26T22:09:07.298Z","avatar_url":"https://github.com/domapic.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Webhook Domapic Module\n\n\u003e Domapic Module for triggering a webhook.\n\n[![Build status][travisci-image]][travisci-url] [![Coverage Status][coveralls-image]][coveralls-url] [![Quality Gate][quality-gate-image]][quality-gate-url] [![js-standard-style][standard-image]][standard-url]\n\n[![NPM dependencies][npm-dependencies-image]][npm-dependencies-url] [![Last commit][last-commit-image]][last-commit-url] [![Last release][release-image]][release-url]\n\n[![NPM downloads][npm-downloads-image]][npm-downloads-url] [![License][license-image]][license-url]\n\n---\n\n## Intro\n\nThis package starts a Domapic Module that with ability called \"webhook\" that make a request to a certain url.\n\nIt can be used alone, but also can be connected to a [Domapic Controller][domapic-controller-url] to get the most out of it.\n\n## Installation\n\n```bash\nnpm i webhook-domapic-module -g\n```\n\n## Start the server\n\n```bash\ndomapic-webhook start --url=http://foo-domain.com/api/trigger-webhook --method=POST --save\n```\n\nThe server will be started in background using [pm2][pm2-url].\n\nTo display logs, type:\n\n```bash\ndomapic-webhook logs #--lines=300\n```\n\n## Options\n\nThe module, apart of all common [domapic services options][domapic-service-options-url], provides custom options for configuring the webhook:\n\n* `url` - Url of the webhook to be triggered.\n* `method` - HTTP method to use when requesting the webhook url. Can be `GET` or `POST`\n\n## Connection with Domapic Controller\n\nConnect the module with a Domapic Controller providing the Controller url and connection token (you'll find it the Controller logs when it is started):\n\n```bash\ndomapic-webhook start --controller=http://192.168.1.110:3000 --controllerApiKey=fo--controller-api-key\n```\n\nNow, the module can be controlled through the Controller interface, or installed plugins.\n\n## Stand alone usage\n\nDomapic modules are intended to be used through Domapic Controller, but can be used as an stand-alone service as well. Follow next instructions to use the built-in api by your own:\n\n### Rest API\n\nWhen the server is started, you can browse to the provided Swagger interface to get all the info about the api resources.  Apart of all api methods common to all [Domapic Services][domapic-service-url], the server provides one [_Domapic Ability_][domapic-service-abilities-url] for triggering the webhook, which generates one extra API resource:\n\n* `/api/abilities/webhook/action` - Trigger the webhook. Will return a 502 status code when webhook service fails.\n\n### Authentication\n\nThe server includes the [Domapic Services][domapic-service-url] authentication method, which is disabled by default for `127.0.0.1`.\nYou can disable the authentication using the `--authDisabled` option (not recommended if your server is being exposed to the Internet). Read more about [available options in the domapic services documentation][domapic-service-options-url].\n\nIf you want to authenticate when requesting from another IPs, look for the api key automatically generated and intended to be used by Domapic Controller when the server is started. You'll find it in the server logs:\n\n```\n-----------------------------------------------------------------\nTry adding connection from Controller, using the next service Api Key: HMl6GHWr7foowxM40CB6tQPuXt3zc7zE\n-----------------------------------------------------------------\n```\n\nTo make your own requests to the api, provide this token using the `X-Api-Key` header.\n\nUse the mentioned api key also for authenticating when using the Swagger interface.\n\n## Alternative command line methods\n\n### Not global installation\n\nIf the package is not installed globally, you can replace the `domapic-webhook` command in examples above by `npm run domapic-webhook --` (commands must be executed inside the package folder in that case)\n\n### Not background mode\n\nIf you don't want to use the built-in background runner, you can start the server directly, attaching logs to current `stdout`. Move to the package folder and replace the `domapic-webhook` command of examples above by `node server.js`. Press `CTRL+C` to stop the server.\n\n\n[coveralls-image]: https://coveralls.io/repos/github/javierbrea/webhook-domapic-module/badge.svg?branch=master\n[coveralls-url]: https://coveralls.io/github/javierbrea/webhook-domapic-module\n[travisci-image]: https://travis-ci.com/javierbrea/webhook-domapic-module.svg?branch=master\n[travisci-url]: https://travis-ci.com/javierbrea/webhook-domapic-module\n[last-commit-image]: https://img.shields.io/github/last-commit/javierbrea/webhook-domapic-module.svg\n[last-commit-url]: https://github.com/javierbrea/webhook-domapic-module/commits\n[license-image]: https://img.shields.io/npm/l/webhook-domapic-module.svg\n[license-url]: https://github.com/javierbrea/webhook-domapic-module/blob/master/LICENSE\n[npm-downloads-image]: https://img.shields.io/npm/dm/webhook-domapic-module.svg\n[npm-downloads-url]: https://www.npmjs.com/package/webhook-domapic-module\n[npm-dependencies-image]: https://img.shields.io/david/javierbrea/webhook-domapic-module.svg\n[npm-dependencies-url]: https://david-dm.org/javierbrea/webhook-domapic-module\n[quality-gate-image]: https://sonarcloud.io/api/project_badges/measure?project=webhook-domapic-module\u0026metric=alert_status\n[quality-gate-url]: https://sonarcloud.io/dashboard?id=webhook-domapic-module\n[release-image]: https://img.shields.io/github/release-date/javierbrea/webhook-domapic-module.svg\n[release-url]: https://github.com/javierbrea/webhook-domapic-module/releases\n[standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg\n[standard-url]: http://standardjs.com/\n\n[domapic-controller-url]: https://www.npmjs.com/package/domapic-controller\n[domapic-service-options-url]: https://github.com/domapic/domapic-service#options\n[domapic-service-abilities-url]: https://github.com/domapic/domapic-service#abilities\n[domapic-service-url]: https://github.com/domapic/domapic-service\n[pm2-url]: http://pm2.keymetrics.io/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomapic%2Fwebhook-domapic-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdomapic%2Fwebhook-domapic-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdomapic%2Fwebhook-domapic-module/lists"}