graphql-engine/community/boilerplates/auth-webhooks/nodejs-express
Rikin Kachhia 3696d92743 add github workflow to compress new images in PRs
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
GitOrigin-RevId: cfef3585b120d82cafe5343cfceddbcd05969a15
2021-03-10 20:55:02 +00:00
..
assets add github workflow to compress new images in PRs 2021-03-10 20:55:02 +00:00
.gitignore add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
app.json remove auth0 webhook ref from docs and community (#1341) 2019-01-08 16:36:16 +05:30
package.json update auth-webhook boilerplates for node (#4885) 2020-05-26 14:43:58 +05:30
Procfile add community boilerplates and examples (#430) 2018-09-13 12:00:07 +05:30
README.md update docs link to avoid redirects 2021-03-01 18:51:18 +00:00
server.js update auth-webhook boilerplates for node (#4885) 2020-05-26 14:43:58 +05:30

Sample Auth Webhook for Hasura GraphQL engine

This is a sample auth webhook for authenticating requests to the Hasura GraphQL engine.

It has boilerplate code written in server.js where you can handle authentication.

Quick deploy

Run the following commands:

git clone https://github.com/hasura/graphql-engine
cp -r graphql-engine/community/boilerplates/auth-webhooks/nodejs-express <some-dir>
cd <some-dir>
git init && git add . && git commit -m "init auth webhook"

You need to setup a Heroku app:

heroku apps:create
git push heroku master

Deploy using Now

Run the following commands to deploy using Now.

git clone https://github.com/hasura/graphql-engine
cd graphql-engine/community/boilerplates/auth-webhooks/nodejs-express
npm install -g now
now

Deploy with Glitch

Click the following button to edit on glitch

glitch-deploy-button

Usage with Hasura GraphQL engine

Once you have deployed this webhook, you can use it along with the GraphQL engine. You have to set the webhook URL as an environment variable in the docker container that runs the GraphQL engine.

Read the docs.