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 🙏

© 2026 – Pkg Stats / Ryan Hefner

lokicms-plugin-webhooks

v1.0.0

Published

Outbound webhooks plugin for LokiCMS - Send HTTP notifications on CMS events

Readme

Webhooks Plugin for LokiCMS

Send HTTP webhooks when events occur in LokiCMS. Compatible with n8n, Zapier, Make, and any webhook receiver.

Features

  • Event-driven: Trigger webhooks on content and user events
  • Multiple endpoints: Configure different URLs for different events
  • Content type filtering: Only trigger for specific content types
  • HMAC signatures: Secure webhooks with SHA-256 signatures
  • Custom headers: Add authentication or custom headers
  • Automatic retries: Configurable retry on failure
  • Delivery logs: Track all webhook deliveries
  • MCP tools: AI-accessible webhook management

Installation

npm install lokicms-plugin-webhooks

Configuration

Add to plugins.json:

{
  "name": "webhooks",
  "enabled": true,
  "source": "npm",
  "package": "lokicms-plugin-webhooks",
  "settings": {
    "maxRetries": 3,
    "retryDelay": 5000,
    "timeout": 30000
  }
}

Supported Events

| Event | Description | |-------|-------------| | entry:afterCreate | Content entry created | | entry:afterUpdate | Content entry updated | | entry:afterDelete | Content entry deleted | | entry:afterPublish | Content entry published | | entry:afterUnpublish | Content entry unpublished | | user:afterCreate | User account created | | user:afterUpdate | User account updated | | user:afterDelete | User account deleted | | media:afterUpload | Media file uploaded | | media:afterDelete | Media file deleted |

API Endpoints

Base path: /api/plugins/webhooks

Endpoints Management

# List all endpoints
GET /endpoints

# Get endpoint details
GET /endpoints/:id

# Create endpoint
POST /endpoints
{
  "name": "n8n Workflow",
  "url": "https://n8n.example.com/webhook/abc123",
  "events": ["entry:afterCreate", "entry:afterUpdate"],
  "secret": "my-secret-key",
  "headers": {
    "X-Custom-Header": "value"
  },
  "enabled": true,
  "contentTypeFilter": ["post", "page"]
}

# Update endpoint
PUT /endpoints/:id

# Delete endpoint
DELETE /endpoints/:id

# Test endpoint
POST /endpoints/:id/test

Deliveries & Events

# List delivery logs
GET /deliveries
GET /deliveries?endpointId=xxx&status=failed&limit=50

# List supported events
GET /events

# Reload endpoints (after manual changes)
POST /reload

Webhook Payload

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "event": "entry:afterCreate",
  "timestamp": 1703980800000,
  "contentType": "post",
  "data": {
    "id": "abc123",
    "title": "My Post",
    "slug": "my-post",
    "content": { ... },
    "status": "published",
    "createdAt": 1703980800000
  }
}

Webhook Headers

Every webhook request includes:

| Header | Description | |--------|-------------| | Content-Type | application/json | | User-Agent | LokiCMS-Webhooks/1.0 | | X-Webhook-ID | Unique delivery ID | | X-Webhook-Event | Event name | | X-Webhook-Timestamp | Unix timestamp | | X-Webhook-Signature | HMAC-SHA256 signature (if secret configured) |

Signature Verification

If you configure a secret, the plugin signs payloads with HMAC-SHA256:

// Node.js verification example
const crypto = require('crypto');

function verifySignature(payload, signature, secret) {
  const expected = 'sha256=' + crypto
    .createHmac('sha256', secret)
    .update(JSON.stringify(payload))
    .digest('hex');

  return crypto.timingSafeEqual(
    Buffer.from(signature),
    Buffer.from(expected)
  );
}

// Express middleware
app.post('/webhook', (req, res) => {
  const signature = req.headers['x-webhook-signature'];
  if (!verifySignature(req.body, signature, 'your-secret')) {
    return res.status(401).send('Invalid signature');
  }
  // Process webhook...
});

n8n Integration

  1. In n8n, create a new workflow with a Webhook trigger
  2. Copy the webhook URL (e.g., https://n8n.example.com/webhook/abc123)
  3. Create endpoint in LokiCMS:
curl -X POST http://localhost:3005/api/plugins/webhooks/endpoints \
  -H "Content-Type: application/json" \
  -d '{
    "name": "n8n Content Updates",
    "url": "https://n8n.example.com/webhook/abc123",
    "events": ["entry:afterCreate", "entry:afterUpdate", "entry:afterDelete"],
    "enabled": true
  }'

Zapier Integration

  1. Create a Zap with Webhooks by Zapier trigger
  2. Choose "Catch Hook" and copy the webhook URL
  3. Create endpoint in LokiCMS with the Zapier URL

MCP Tools

Available tools for AI agents:

| Tool | Description | |------|-------------| | webhooks_create_webhook | Create a new endpoint | | webhooks_update_webhook | Update an endpoint | | webhooks_delete_webhook | Delete an endpoint | | webhooks_test_webhook | Test an endpoint | | webhooks_list_webhooks | List all endpoints | | webhooks_list_deliveries | View delivery logs | | webhooks_list_webhook_events | List supported events |

Content Types

The plugin creates these content types:

  • webhooks-webhook-endpoint - Endpoint configurations
  • webhooks-webhook-delivery - Delivery logs

License

MIT