WeWork Incoming Webhooks
Installation
$ npm install wework
Usage
Initialize the webhook
The package exports a IncomingWebhook
class. You'll need to initialize it with the URL you received from WeWork group, see the webhooks docs.
; // Read a url from the environment variablesconst url = processenvWEWORK_WEBHOOK_URL; // Initializeconst webhook = url;
Send a Message
Something interesting just happened in your app, so its time to send the message! Just call the
.sendText(message)
method on the webhook. The message
parameter is an string.
;const url = processenvWEWORK_WEBHOOK_URL; const webhook = url; // Send the messageasync { // send text message await webhook; // send markdown message await webhook // send news articles await webhook};