Code Monkey home page Code Monkey logo

sponsors-functions's Introduction

sponsors-functions

GitHub Sponsors webhook receiver and Discord forwarder, written in Node.js

License: MIT OpenFaaS

This function is hosted on OpenFaaS Cloud, see the commits page for the build logs. The dashboard is private, but contains runtime logs and metrics.

Subscribe to my Insiders Updates by Sponsoring me via GitHub:

Usage

This function receives and validates a webhook from GitHub Sponsors using the node12 template from OpenFaaS.

Each message is verified using the crypto library and HMAC.

Messages that pass HMAC are then sent over to a secret webhook URL and appear in Discord

It is triggered by any event from GitHub Sponsors

There's a switch statement on each event, which sends send a "pretty" string such as Person X just sponsored you, or Person X cancelled their sponsorship including an appropriate emoticon for the action taken by the user.

Example

Deployment

You can pick between self-hosted OpenFaaS or OpenFaaS Cloud.

With OpenFaaS Cloud

export WEBHOOK=""
export SLACK=""

faas-cli cloud seal --name alexellis-sponsors \
 --literal webhook-secret=$WEBHOOK \
 --literal slack-url=$SLACK
  • Fire a test event from your sponsors page

With OpenFaaS or faasd

You can also host a simpler version of OpenFaaS and deploy the function there:

See also: SponsorshipEvent

sponsors-functions's People

Contributors

alexellis avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sponsors-functions's Issues

Add Slack messages

Adding Slack messages will help a maintainer to monitor the health and pulse of sponsorships

hook

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.