[Issue]: Write Plugin Webhook Implementation Guide
Parent Epic: #57 - UDL as Production Data Layer
Phase: 6 - Documentation
Estimated Time: 0.5 day
Summary
Write documentation explaining how plugin authors can implement webhook handlers in their plugins, including signature verification, payload processing, and node updates.
Context from Epic
The epic shows the webhook registration API:
registerWebhook({
path: 'contentful-update',
handler: async (req, res) => { /* process, update nodes */ },
verifySignature: (req) => verifyContentfulSignature(req, secret),
});
Plugin authors need a guide to implement this in their plugins.
Technical Specification
Documentation Content
Plugin Webhook Implementation Guide:
-
Introduction
- What webhooks enable (real-time updates)
- How UDL routes webhooks to plugins
-
Registering Webhooks
export async function sourceNodes({ actions, registerWebhook, options }) {
// Source initial data...
registerWebhook({
path: 'entry-update',
description: 'Handle Contentful entry updates',
handler: async (req, res, context) => {
// Process webhook
},
verifySignature: (req, body) => {
// Verify signature
},
});
}
-
Handler Implementation
- Accessing raw body and parsed JSON
- Using context.actions to update nodes
- Returning appropriate responses
-
Signature Verification
- Why verification matters
- Platform-specific examples (Contentful, Shopify)
- Handling verification failures
-
Complete Example
- Full Contentful webhook implementation
- Full Shopify webhook implementation
Files to Create
docs/content/5.advanced/3.plugin-webhooks.md
Implementation Tasks
Acceptance Criteria
Dependencies
Definition of Done
[Issue]: Write Plugin Webhook Implementation Guide
Parent Epic: #57 - UDL as Production Data Layer
Phase: 6 - Documentation
Estimated Time: 0.5 day
Summary
Write documentation explaining how plugin authors can implement webhook handlers in their plugins, including signature verification, payload processing, and node updates.
Context from Epic
The epic shows the webhook registration API:
Plugin authors need a guide to implement this in their plugins.
Technical Specification
Documentation Content
Plugin Webhook Implementation Guide:
Introduction
Registering Webhooks
Handler Implementation
Signature Verification
Complete Example
Files to Create
docs/content/5.advanced/3.plugin-webhooks.mdImplementation Tasks
Acceptance Criteria
Dependencies
Definition of Done