Skip to content

Repository files navigation

Solid Webhook Client

Installation

npm i solid-webhook-client

Usage

import{subscribe,unsubscribe,parseIncomingRequest}from"solid-webhook-client";import{fetch}from"@inrupt/solid-client-authn-js";importexpressfrom"express";importbodyParserfrom"body-parser";constapp=express();app.post("/webhook",bodyParser.json({type: "application/ld+json"}),async(req,res)=>{console.log("Webhook request");if(awaitverifyAuthIssuer(req.headers.authorization)==="https://example.pod"){console.log("Webhook valid");console.log(JSON.parse(req.body));}else{console.log("This issuer is invalid");}res.sendStatus(200);});app.listen(3000,()=>{// Create the webhook subscriptionsubscribe("https://example.pod/resource1",{fetch: fetch});});

About

A JavaScript Client for Solid Webhooks

Resources

Stars

1 star

Watchers

2 watching

Forks

Releases

Packages

Used by

Contributors

Languages