Git Product home page Git Product logo

serverless-slack-invite's Introduction

serverless-slack-invite

Builds Slack workspace Maturity badge - level 2

A serverless service providing badge and invitation gateway for public Slack channels. You'll be able to bring this up on AWS in minutes.

Installation on Lambda

Step 1: Generate AWS access and secret key by creating a user in AWS IAM with AdministratorAccess permission.

Step 2: Generate a Slack token using this page.

Step 3: Set following ENV variables:

  • AWS_ACCESS_KEY_ID: Your AWS access key generated in Step 1
  • AWS_SECRET_ACCESS_KEY: Your AWS secret access key generated in Step 1
  • SLACK_API_TOKEN: The slack API token generated in Step 2
  • SLACK_SUBDOMAIN: Your slack subdomain for your workspace https://<your-subdomain>.slack.com

Step 4: Run following commands:

yarn install
yarn build
serverless deploy

You should be able to pass the ENV variables like this:

AWS_ACCESS_KEY_ID="abc" AWS_SECRET_ACCESS_KEY="abc" SLACK_API_TOKEN="abc" SLACK_SUBDOMAIN="your-subdomain" serverless deploy

It should give you a link to the service!

Running as standalone Webserver

Step 1: Set following ENV variables:

export SLACK_API_TOKEN='abc'
export SLACK_SUBDOMAIN='your-subdomain'

Step 2: Install, build and start:

yarn install
yarn build
yarn start

Endpoints

GET /badge.svg

Displays an SVG badge with the number of online users and total users in Slack.

You can embed this badge in your Github repo using following snippet:

[![Slack](https://slackinvite.dev.tophat.com/badge.svg)](https://opensource.tophat.com/#join-slack)

Slack


POST /invite

By posting email to this endpoint, a Slack invitation will be sent from the user who generated the Slack API token.

This enpoint will return 400 if the email is not valid or user is already invited with following JSON as response:

{"success": false, "message": "Error Message" }

GET /stats

Returns number of active and total members on Slack in following format:

{"success": true, "stats": {"total": 39, "active": 25}}

Contributors

Thanks goes to these wonderful people (emoji key):


Siavash Bidgoly

๐Ÿ’ป ๐Ÿ“– ๐Ÿš‡

Jake Bolam

๐Ÿ“– ๐Ÿš‡

Credits

Thanks to Carol Skelly for donating the github organization!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.