npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ep_webhooks

v1.0.14

Published

Webhooks for Etherpad Lite.

Downloads

121

Readme

ep_webhooks

Webhooks for Etherpad Lite.

WORK IN PROGRESS

While it's somewhat useful, work is in progress. See the TODO below. Any ideas and contributions are welcome, see the TODO section first.

Configuration

In your Etherpad Lite settings.json:

  "ep_webhooks": {
    "apiKey": "superSecretAPIkeySentInXApiKeyHeader",
    "caCert": "-----BEGIN CERTIFICATE-----\nMIIDoDCCAogCCQC85R3CVrF5aDANBgkqhkiG9w0BAQsFADCBkTELMAkGA1UEBhMC\nRUUxETAPBgNVBAgMCEhhcmp1bWFhMRAwDgYDVQQHDAdUYWxsaW5uMRIwEAYDVQQK\nDAlDaXRpemVuT1MxCzAJBgNVBAsMAklUMRQwEgYDVQQDDAtkZXYudG9ydS5lZTEm\nMCQGCSqGSIb3DQEJARYXY2l0aXplbm9zLmVzdEBnbWFpbC5j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"pads": {
        "update": ["https://mydomain.com/api/internal/notifications/pads/update"]
    }
  }
  • Where the pads.update configures webhook for pads.update event. See the "Supported hooks" section.
  • You can specify multiple urls, each of them will be called on the event.
  • The hook endpoint can authorize the call by verifying the secret in the X-API-KEY header
  • The caCert is optional, it enables you to provide a CA certificate in case you call a service which has a certificate that is not in the Node.JS trusted list by default, like self-signed certificates.

Supported hooks

pads.update

Hook is called when any of the pads is updated. Payload contains the id-s of the pads that have been modified and user id-s of authors and last revision number of that user.

Sample HTTP request made by ep_webhooks to the registered hook url:

POST https://mydomain.com/api/notifications/pads/update
X-API-KEY: supersecretApiKeyForTheMasses
{
    pads: {"pad1":[{"userId": "2e904907-a763-461b-8327-75a0d3fc6d93", rev:3}, {"userId": "2e80db42-8146-48dc-bbfd-a192684c2513", rev: 3}], "pad2":[{"userId":"c9d946f7-1e50-4f93-b205-daa00f2937d2", rev:2}], "pad3":[{"userId": "2e80db42-8146-48dc-bbfd-a192684c2513", rev: 4}]}
}

TODO

  • Create API to register and de-register hooks instead of EP settings.json configuration.
  • Back-off mechanism on errors - if a hook call fails too much, just stop sending or retry, but increase retry delay with each failure.
  • Define method for telling ep_webhooks to temporarily delay calling registered hook.
    • Maybe overkill? You can register/de-register if you want to.
    • For example response headers or HTTP response code. Useful when your system is under heavy load and you want to temporarily delay messages for a longer period of time.