From e52f084370f5f8fb81c1d94d6bb99cbf030329c4 Mon Sep 17 00:00:00 2001 From: anushasquadcast <71700424+anushasquadcast@users.noreply.github.com> Date: Tue, 25 May 2021 18:48:38 +0530 Subject: [PATCH] Add support for Squadcast incidents --- hooks/squadcast/README.md | 11 +++++++++++ hooks/squadcast/index.js | 24 ++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 hooks/squadcast/README.md create mode 100644 hooks/squadcast/index.js diff --git a/hooks/squadcast/README.md b/hooks/squadcast/README.md new file mode 100644 index 0000000..0d467c4 --- /dev/null +++ b/hooks/squadcast/README.md @@ -0,0 +1,11 @@ +### Squadcast + +Get notified in near real-time as errors occur on your site by sending events into Squadcast. + +#### How to obtain your Errorception Webhook in Squadcast: + +1. Head over to Services from the navigation bar on the left +2. For the Service of your choice, click on Alert Sources +3. Search for "Errorception" from the dropdown +4. Copy the Webhook available on the right +5. Use this copied Webhook within Settings > Service Hooks > Squadcast in Errorception \ No newline at end of file diff --git a/hooks/squadcast/index.js b/hooks/squadcast/index.js new file mode 100644 index 0000000..77dd4b9 --- /dev/null +++ b/hooks/squadcast/index.js @@ -0,0 +1,24 @@ +var request = require("request"), + hash = require("node_hash"); + +exports.serviceName = "WebHooks"; + +exports.author = { + name: "Anusha Ravindra", + email: "it@squadcast.com", + github: "SquadcastHub", + twitter: "squadcastHQ" +}; + +exports.onError = function(error, settings, done) { + request({ + url: settings.url, + headers: { + "Content-Type": "application/json", + "User-Agent": "Errorception Notifications" + }, + method: "post", + body: JSON.stringify(error), + timeout: 10000 + }, done); +};