Ghost Webhook/Zapier Integration Development
Ghost sends webhooks on publishing, updates, member creation, and other events. Via Zapier or custom handler these events connect to external systems without writing custom Ghost code.
Webhook Setup
Ghost Admin → Settings → Integrations → Add custom integration → Webhooks. Available events:
-
post.published/post.unpublished/post.deleted -
page.published -
member.added/member.updated/member.deleted -
tag.added/tag.deleted -
subscriber.added
Webhook Handler (Node.js/Express)
import crypto from 'crypto';
function verifyGhostWebhook(body: Buffer, signature: string, secret: string): boolean {
const hmac = crypto.createHmac('sha256', secret);
hmac.update(body);
return hmac.digest('hex') === signature.split('sha256=')[1];
}
app.post('/webhooks/ghost', express.raw({ type: 'application/json' }), (req, res) => {
const sig = req.headers['x-ghost-signature'] as string;
if (!verifyGhostWebhook(req.body, sig, process.env.GHOST_WEBHOOK_SECRET!)) {
return res.sendStatus(401);
}
const payload = JSON.parse(req.body.toString());
const event = req.headers['x-ghost-event']; // 'post.published'
handleGhostEvent(event as string, payload);
res.sendStatus(200);
});
async function handleGhostEvent(event: string, payload: any) {
switch (event) {
case 'post.published':
// Send to Slack, update sitemap, notify Telegram channel
await notifySlack(payload.post.current);
await rebuildSitemap();
break;
case 'member.added':
await addToMailchimp(payload.member.current);
break;
}
}
Zapier Integration
Ghost has official Zapier app. Example Zaps:
- Ghost → Slack: notify channel on publish
- Ghost → Twitter/X: auto-post with title and link
- Ghost → Airtable: log new members
- Ghost → ConvertKit: add subscribers to email sequence
For non-standard events — Zapier Webhooks (Catch Hook):
Trigger: Ghost webhook → Zapier Webhook URL
Action: POST to Zapier → any action in 6000+ services
Auto Cross-posting to Social Media
// On post.published
async function crossPost(post: GhostPost) {
const text = `${post.title}\n\n${post.excerpt || ''}\n\n${post.url}`;
// Twitter/X via API v2
await twitterClient.v2.tweet({
text: text.substring(0, 280),
});
// Telegram
await bot.sendMessage(CHANNEL_ID, text, {
parse_mode: 'HTML',
reply_markup: {
inline_keyboard: [[{ text: 'Read', url: post.url }]],
},
});
}
Setting up 2–3 webhook integrations (Slack + Telegram + sitemap rebuild) — 4–8 hours. Zapier automations without code — 1–2 hours.







