Giter Site home page Giter Site logo

ghost-member-discord-notifications's Introduction

A simple webhook built with Cloudflare Workers for taking new member notifications from Ghost and posting them into a Discord server.

For more instructions on how to use this in practice, check out the associated blog post on bytesized.xyz.

You'll need a Cloudflare Workers account (free plan is OK) and our command-line tool Wrangler installed and configured on your machine.

If you aren't familiar with Cloudflare Workers, it's worthwhile to spend 20-30 minutes diving through my Egghead.io course. I'll teach you how to set up your Cloudflare account, sign up for Workers, and deploy your first project with Wrangler, our command-line tool. Watch it for free on Egghead!

Configuration

First, clone the project locally:

$ git clone [email protected]:signalnerve/ghost-member-discord-notifications.git

Next, update the account_id field in wrangler.toml with your account ID. To find that value, you can use wrangler whoami, or follow the instructions for finding it in our Quick Start.

After publishing your project, you'll need to set a number of secrets using wrangler secret, in the format wrangler secret put key (using the interactive prompt, pass the value as specified below):

key value
DISCORD_URL An authenticated Discord webhook URL (see "Webhook URL" )
PASSWORD A unique string password (see "Password")

Webhook URL

The DISCORD_URL value you pass in as a secret should be an authenticated Discord URL as created in the "Integrations -> Webhooks" UI found in your Discord channel settings. For a guide on creating this, see the associated blog post for this codebase.

Password

A unique (and secret) password based on a string. This provides simple validation that only your known webhook can make requests to this endpoint. This is sent as a query parameter from Ghost to your serverless URL. (BTW this isn't perfect security, sorry, but it's a notification webhook... chill)

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.