This application emulates the missing Safety Check feature on Workplace by Facebook. It sends a message to all members of a list of groups within your community or a list of users directly and asks them whether they need help.
This custom integration also has hooks for saving the status of the request into a DB (alert sent, alert read, user is OK, user needs help) as well as notifying any given administrator of users requiring some help.
You need to be able to run node version 6.10 and host on a server capable of handling the load of the amount of users you need to notify.
Alternatively, this project comes with a custom integration with the serverless framework that allows you to deploy code quickly in the cloud (tested on AWS Lambda).
Adapting for your own hosting needs should not be complicated. We can help you host this project if you need assistance. Contact us on [email protected].
Locally:
- clone this repository on a server that can run nodejs (tested with node 6.10).
- run
npm install
to install all dependencies. - create a custom
.env.yml
file based on.env.example.yml
and edit accordingly to your parameters and needs. - in
launch.js
, setup the target groups and users for your safety check alert. You can add any number of group IDs as long as the number of users per group is smaller than 10k, and any number of single user IDs.
On workplace:
- setup a custom integration in your Workplace admin panel with the following settings:
read content
,manage groups
,message any member
. - create a page webhook with the following callback URL
http://{hostname}/webhook
, and pick any string you want forVerify Token
. - subscribe your webhook to
messages
,message_deliveries
,messaging_postbacks
andmessage_reads
. - retrieve the App Secret and create and Access Token for your app.
- give it a name and icon of your liking, then click Save.
To deploy on AWS Lambda (recommended solution)
- install serverless
npm i -g serverless
- deploy to lambda with
sls deploy
- retrieve the wbehook URL and use that as your callback URL
Once everything is correctly setup, launching an alert simply requires you to run node launch
, or sls invoke local -f launch
if you use serverless directly.
The webhook (in handler.js
) will handle any response for you.
You can extend this app to your liking by saving user responses in a database or notifying managers that any user requires your assistance.
The places where you should add your custom code for this are documented. Search for EXTENSION:
in the code.
If you require any help in setting this up, you can open an issue or alternatively, contact us on [email protected] for getting help with custom integrations.
Clevy is a French company based in Paris dedicated to providing employees of large companies with great tools they can use everyday. We are the makers of www.clevy.io, a chatbot solution that helps employees access and share information easily and reduce emails as well as interruptions in their workday. Contact us at [email protected] for more information about Clevy!
Feel free to open pull requests for any bugfix or new features!