Skip to content

A basic MongoDB Stitch Slack integration using functions

Notifications You must be signed in to change notification settings

chickenbug/stitch-slack-pack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 

Repository files navigation

stitch-slack-pack

This is a proof of concept for importable, continuously tested Slack WebAPI integration for for MongoDB Stitch apps made using only Stitch entities.

Usage Instructions

To use, import all functions that end with Class and the slack_http service into your stitch application using stitch-cli with --stategy=merge.

For more information on the stitch cli see here.

Once set up, you can use the integration inside other stitch functions as follows:

const SlackClass = context.functions.execute('SlackClass');
const slack = new SlackClass();
slack.Chat.postMessage(...);

Testing

Testing is done by running API requests against the Slack API for a test workspace. Tests are run after every push and current test status can be seen here.

Implementation

The key components for the Slack integration are several Stitch private functions that return classes that can send http requests the Slack Web API. The functions to note are:

  • SlackClass
  • ChatClass
  • SearchCLass
  • ChannelsClass
  • ConversationsClass
  • PinsClass
  • RemindersClass
  • IMClass
  • GroupsClass
  • UtilClass

SlackClass contains all classes, however if needed the individual classes can also be used modularly.

The key components for the continuous integration are:

  • A github webhook called runTests that runs tests after every push and updates an atlas collection with the result
  • A simple static hosting page that displays the results of the test

About

A basic MongoDB Stitch Slack integration using functions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published