Ghost Custom Integrations — Zapier, Slack, Custom Apps and SSO
In this tutorial, you'll learn how to integrate Ghost with external services — connecting Zapier for no-code automation, sending Slack notifications, building custom applications with the Ghost API, and setting up Single Sign-On with external authentication providers.
What You'll Learn
- The Ghost Integration system and where to find it
- Connecting Zapier for automated workflows
- Slack integration for publishing notifications
- Building custom applications with Ghost APIs
- SSO and external authentication concepts
- Creating custom authentication flows
- Integration security best practices
- Managing multiple integrations
- Monitoring integration health
Why It Matters
No CMS exists in isolation. Ghost integrates with your broader workflow — email, analytics, CRM, automation, and team communication tools. Understanding the integration options lets you connect Ghost with the tools you already use, reducing manual work and creating automated publishing workflows.
Real-World Use
A content team uses five integrations: Zapier sends new posts to their social media scheduler, Slack notifies the team when a post is published, Google Analytics tracks site traffic, a custom integration pushes new members to their Mailchimp list, and SSO lets team members log in with their Google Workspace accounts. All integrations are managed from the Ghost admin Integrations page.
Learning Path
flowchart LR A["Webhooks"] --> B["Custom Integrations
You are here"]:::current B --> C["Headless Ghost"] C --> D["SEO Settings"] classDef current fill:#38bdf8,color:#0f172a,stroke-width:2px
The Integration System
Ghost's integration system is built around the Integrations page (Settings > Integrations).
Built-in Integrations
| Integration | Purpose |
|---|---|
| Zapier | No-code automation with 5,000+ apps |
| Slack | Publishing notifications |
| AMP | Accelerated Mobile Pages |
| Unsplash | Free stock photos in editor |
| First Promoter | Affiliate marketing |
Custom Integrations
Create your own integrations to get API keys for custom applications.
Zapier Integration
Zapier connects Ghost to thousands of apps without writing code.
Setting Up Zapier
- In Ghost admin, go to
Settings > Integrations > Zapier. - Copy the Zapier webhook URL.
- Go to Zapier and create a new Zap.
- Select "Webhooks by Zapier" as the trigger app.
- Choose "Catch Hook" as the event.
- Paste the Ghost webhook URL and test.
Triggers Available
- New Post: When a post is published
- New Member: When a member signs up
- New Subscription: When a paid subscription starts
Example Zaps
| Trigger | Action | Use Case |
|---|---|---|
| New Post | Share to Twitter | Auto-promote articles |
| New Post | Create Slack message | Team notifications |
| New Member | Add to Mailchimp list | Sync subscribers |
| New Member | Create Google Sheets row | Track signups |
| New Post | Create Buffer post | Social media scheduling |
| New Member | Send custom welcome email | Automated onboarding |
Setting Up a Zap
- Create a new Zap in Zapier.
- Trigger: Ghost > New Post.
- Authenticate with your Ghost Zapier URL.
- Action: Choose your target app (e.g., Twitter).
- Map Ghost post fields (title, URL, excerpt) to the action fields.
- Test and turn on the Zap.
Slack Integration
The built-in Slack integration sends notifications to a Slack channel when content is published.
Setting Up Slack
- In Ghost admin, go to
Settings > Integrations > Slack. - Click "Connect to Slack."
- Authorize Ghost to post to your Slack workspace.
- Select the channel for notifications.
- Save.
Notification Format
When a post is published, Slack receives:
New post published: "Post Title"
By Author Name
URL: https://yoursite.com/post-slug/
Customizing Slack Notifications
The built-in integration sends a fixed format. For custom Slack messages:
- Do not use the Slack integration.
- Create a webhook for
post.published. - Your webhook endpoint sends a custom Slack message using Slack's Web API.
Custom Applications
Ghost's API architecture supports building custom applications on top of your CMS.
Integration Patterns
flowchart LR A["Your App"] --> B["Ghost Content API"] A --> C["Ghost Admin API"] B --> D["Public content"] C --> E["Full CMS access"] C --> F["Webhooks"] style A fill:#38bdf8,color:#0f172a
Reading Public Content
// Content API - safe for client-side
const contentAPI = `https://yoursite.com/ghost/api/content/`;
const key = 'CONTENT_API_KEY';
async function getRecentPosts() {
const res = await fetch(`${contentAPI}posts/?key=${key}&limit=5`);
return res.json();
}
Full CMS Access (Server-Side)
// Admin API - server-side only
const GhostAdminAPI = require('@tryghost/admin-api');
const api = new GhostAdminAPI({
url: 'https://yoursite.com',
key: 'YOUR_ADMIN_API_KEY',
version: 'v5.0'
});
async function automateContent() {
// Create a post, update tags, schedule it
const post = await api.posts.add({
title: 'Automated Post',
html: '<p>Generated by our custom app</p>',
status: 'draft',
tags: ['automation', 'api']
});
}
Use Cases for Custom Apps
- Content import tools: Bulk import from CSV or other CMS formats
- Editorial calendars: Build a custom calendar interface
- Analytics dashboards: Combine Ghost data with external analytics
- Mobile apps: Native iOS/Android content readers
- Custom dashboards: Member-facing account portals
- Content syndication: Automatically push content to other platforms
SSO and External Authentication
Ghost supports Single Sign-On through custom integration.
SSO Concepts
SSO lets users log in using their existing accounts from another service (Google, GitHub, Auth0, your app's user database).
Ghost does not have built-in SSO for the admin panel, but you can implement it for member authentication.
Custom Member Authentication
// Step 1: Create or find the member via Admin API
async function authenticateMember(email, name) {
// Check if member exists
const existing = await api.members.browse({
filter: `email:${email}`
});
if (existing.length > 0) {
return existing[0];
}
// Create new member
return await api.members.add({
name,
email,
labels: ['sso-user']
});
}
// Step 2: Generate a Ghost login token
async function generateLoginToken(memberId) {
// Call Ghost Identity API to get a login token
const response = await fetch(
`https://yoursite.com/ghost/api/admin/members/${memberId}/token/`,
{
headers: {
'Authorization': `Ghost ${ADMIN_TOKEN}`,
'Accept-Version': 'v5.0'
}
}
);
return response.json();
}
SSO Flow
- User logs into your external auth system.
- Your backend verifies the user's identity.
- Your backend creates/finds the Ghost member via Admin API.
- Your backend generates a one-time login token.
- The user is redirected to Ghost with the token.
- Ghost authenticates the user without them entering a password.
Integration Management
Creating Integrations
Go to Settings > Integrations > Add custom integration. Each integration gets:
- A name for identification
- Content API key (public, read-only)
- Admin API key (secret, full access)
- Webhook configuration
Integration Health
In the integration details page:
- API calls: Track how many API calls the integration made
- Webhook deliveries: Status of recent webhook deliveries
- Created: When the integration was created
Revoking Integrations
Click "Revoke" on any integration to invalidate its API keys. This immediately blocks all requests using those keys. Use this when:
- An integration is no longer needed
- An API key may have been compromised
- A team member leaves who managed the integration
Common Mistakes
Using Admin API keys where Content API keys suffice: If you only need to read public content, use the Content API key. It is simpler and safer. Reserve Admin API keys for operations that require write access.
Not testing Zapier integrations before going live: Zapier Zaps can fail silently if the field mapping is wrong. Test each Zap with a real Ghost event before relying on it.
Overloading a single integration: Create separate integrations for different purposes. One integration for "Slack notifications" and another for "Content automation" makes it easier to manage and revoke access.
Storing API keys in version control: API keys are sensitive credentials. Use environment variables or a secrets manager. Never commit them to Git.
Ignoring rate limits when building custom apps: Ghost API has rate limits. Your custom app should implement Caching and backoff to avoid being throttled.
Practice Questions
What is the difference between a built-in integration and a custom integration? Answer: Built-in integrations (Zapier, Slack, AMP, Unsplash) are pre-configured by Ghost with specific functionality. Custom integrations are user-created and provide Content API and Admin API keys that you can use in your own applications.
How does the Zapier integration work with Ghost? Answer: Ghost provides a Zapier webhook URL. In Zapier, you create a Zap with "Webhooks by Zapier" as the trigger, using "Catch Hook" event. Ghost sends POST requests to this URL when events occur (new post, new member). You then map the event data to actions in other apps.
What security considerations apply when building custom integrations? Answer: Admin API keys must never be exposed in client-side code. Each integration should have its own key pair so you can revoke individual integrations. Store keys in environment variables, not in code. Use webhook signatures to verify incoming requests.
Challenge: Set up three integrations on a Ghost site: (1) Zapier integration that sends new post data to a Google Sheet, (2) Slack integration for publishing notifications, (3) a custom integration that creates a member whenever a new user signs up in a mock external service (simulated with a script).
FAQ
Mini Project
Your task: Build an automated content distribution system using Ghost integrations.
- Create a custom integration in Ghost.
- Set up a Zapier Zap that triggers on "New Post" and posts the title + URL to Twitter.
- Set up a Slack integration for team notifications.
- Build a simple Node.js webhook receiver that:
- Receives
post.publishedevents - Extracts the post title, URL, and tags
- Posts a formatted message to a Discord webhook
- Logs the event to a local file
- Receives
- Publish a test post and verify all three destinations receive the notification.
This exercise gives you a real-world multi-channel content distribution pipeline.
What's Next
Now that you understand integrations, learn to use Ghost as a headless CMS:
Continue to Lesson 29: Headless Ghost — Use Ghost as a headless CMS with React, Next.js, and Vue.
Related lessons:
- Content API — API for headless content access
- SEO Settings — SEO for headless Ghost sites
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro