SIGNL4 Alerting avatar
SIGNL4 Alerting

Pricing

Pay per usage

Go to Store
SIGNL4 Alerting

SIGNL4 Alerting

Developed by

Ronald Czachara

Ronald Czachara

Maintained by Community

SIGNL4 notifies through persistent mobile push, SMS text and voice calls with acknowledgement, tracking and escalation. Integrated on-call duty and shift scheduling ensures the right people are alerted at the right time.

0.0 (0)

Pricing

Pay per usage

1

Total users

4

Monthly users

1

Runs succeeded

>99%

Last modified

10 months ago

.actor/Dockerfile

# Specify the base Docker image. You can read more about
# the available images at https://docs.apify.com/sdk/js/docs/guides/docker-images
# You can also use any other image from Docker Hub.
FROM apify/actor-node:18
# Copy just package.json and package-lock.json
# to speed up the build using Docker layer cache.
COPY package*.json ./
# Install NPM packages, skip optional and development dependencies to
# keep the image small. Avoid logging too much and print the dependency
# tree for debugging
RUN npm --quiet set progress=false \
&& npm install --omit=dev --omit=optional \
&& echo "Installed NPM packages:" \
&& (npm list --omit=dev --all || true) \
&& echo "Node.js version:" \
&& node --version \
&& echo "NPM version:" \
&& npm --version \
&& rm -r ~/.npm
# Next, copy the remaining files and directories with the source code.
# Since we do this after NPM install, quick build will be really fast
# for most source file changes.
COPY . ./
# Run the image.
CMD npm start --silent

.actor/actor.json

{
"actorSpecification": 1,
"name": "signl4",
"title": "SIGNL4 Alerting",
"description": "SIGNL4 notifies through persistent mobile push, SMS text and voice calls with acknowledgement, tracking and escalation. Integrated on-call duty and shift scheduling ensures the right people are alerted at the right time. SIGNL4 thus provides for an up to 10x faster and effective response to critical situations.",
"version": "0.1",
"meta": {
"templateId": "js-start"
},
"input": "./input_schema.json",
"dockerfile": "./Dockerfile"
}

.actor/input_schema.json

{
"title": "SIGNL4 Alerting",
"type": "object",
"schemaVersion": 1,
"properties": {
"secret": {
"title": "SIGNL4 Secret",
"type": "string",
"description": "SIGNL4 team or integration secret.",
"editor": "textfield",
"isSecret": true
},
"title": {
"title": "Title",
"type": "string",
"description": "Alert title.",
"editor": "textfield",
"prefill": "Alert from APIFY"
},
"message": {
"title": "Message",
"type": "string",
"description": "Alert message.",
"editor": "textfield",
"prefill": ""
},
"data": {
"title": "Data",
"type": "object",
"description": "Data in JSON format.",
"editor": "json"
}
},
"required": ["secret", "title"]
}

src/main.js

1import axios from 'axios';
2
3import { Actor, log } from 'apify';
4
5await Actor.init();
6
7// Structure of input is defined in input_schema.json
8const input = await Actor.getInput();
9const { secret, title, message, data } = input;
10
11// Alert data
12var jsonData = JSON.stringify({
13 'Title': title,
14 'Message': message,
15 'Data': data,
16 'X-S4-SourceSystem': 'Apify'
17})
18
19try {
20 // SIGNL4 webhook URL
21 const res = await axios.post('https://connect.signl4.com/webhook/' + secret, jsonData, {
22 headers: {
23 'Content-Type': 'application/json'
24 }
25 });
26
27 // Result
28 log.info('Result: ' + JSON.stringify(res.data));
29
30 await Actor.setValue('OUTPUT', res.data);
31}
32catch (error) {
33
34 // Error
35 log.error(error);
36
37 await Actor.setValue('OUTPUT', error);
38}
39
40// Gracefully exit the Actor process
41await Actor.exit();

.dockerignore

# configurations
.idea
# crawlee and apify storage folders
apify_storage
crawlee_storage
storage
# installed files
node_modules
# git folder
.git

.gitignore

# This file tells Git which files shouldn't be added to source control
.DS_Store
.idea
dist
node_modules
apify_storage
storage/*
!storage/key_value_stores
storage/key_value_stores/*
!storage/key_value_stores/default
storage/key_value_stores/default/*
!storage/key_value_stores/default/INPUT.json

package.json

{
"name": "js-scrape-single-page",
"version": "0.0.1",
"type": "module",
"description": "This is an example of an Apify actor.",
"engines": {
"node": ">=18.0.0"
},
"dependencies": {
"apify": "^3.1.10",
"axios": "^1.5.0",
"cheerio": "^1.0.0-rc.12"
},
"scripts": {
"start": "node ./src/main.js",
"test": "echo \"Error: oops, the actor has no tests yet, sad!\" && exit 1"
},
"author": "It's not you it's me",
"license": "ISC"
}