# Ghost Integration

> Part of the [NextBlog documentation](https://nextblog.ai/docs.md). Live page: [https://nextblog.ai/docs/integration-ghost](https://nextblog.ai/docs/integration-ghost)

Native markdown publishing to Ghost CMS with full feature support. Ghost natively supports markdown, so your content is published exactly as written.

#### Prerequisites

Before you begin, make sure you have:

- A Ghost site (self-hosted or Ghost Pro)
- Admin access to your Ghost site
- Ability to create custom integrations

### Step 1: Create Custom Integration in Ghost

#### 1.1 Navigate to Ghost Admin

1. Log into your Ghost admin dashboard
2. In the left sidebar, click on **"Settings"**

#### 1.2 Go to Integrations

1. Click on **"Integrations"** in the Settings menu
2. You'll see a list of existing integrations

#### 1.3 Create New Integration

1. Click the **"Add custom integration"** button
2. Enter a name: `NextBlog Integration`
3. Click **"Create"**

#### 1.4 Get Admin API Key

1. After creating the integration, you'll see the integration details
2. Look for the **"Admin API Key"** section
3. You'll see a key in the format: `id:secret` (e.g., `5f8a9b2c3d4e5f6g7h8i9j0:1a2b3c4d5e6f7g8h9i0j1k2l3m4n5o6p7q8r9s0t1u2v3w4x5y6z7`)
4. **Important:** Copy the entire Admin API Key (both the ID and secret, including the colon). You'll need the full `id:secret` format!

### Step 2: Get Your Ghost Site URL

#### 2.1 Find Your Ghost URL

Your Ghost site URL is the base URL of your Ghost installation:

- For Ghost Pro: `https://yourblog.ghost.io`
- For self-hosted: `https://yourdomain.com` or `https://blog.yourdomain.com`

Make sure to use the full URL including `https://`

### Step 3: Configure Ghost Integration in NextBlog

#### 3.1 Navigate to Project Settings

1. Log into your NextBlog dashboard
2. Click on your project to open it
3. Click on **"Settings"**

#### 3.2 Enable Ghost Integration

1. Scroll down to the **"Ghost Integration"** section
2. Toggle the **"Enable Ghost Integration"** switch to ON

#### 3.3 Enter Ghost Credentials

Fill in the following fields:

- **Ghost Site URL:** Enter your Ghost site URL (e.g., `https://yourblog.ghost.io`)
- **Ghost Admin API Key:** Paste the full Admin API Key in `id:secret` format that you copied in Step 1.4

**Important:** The Admin API Key must be in the format `id:secret` with a colon between them. Do not separate them or modify the format.

#### 3.4 Test Connection

1. Click the **"Test Connection"** button
2. Wait for the test to complete
3. If successful, you'll see a green success message
4. If it fails, check:
  - That the URL is correct and includes https://
  - That the Admin API Key is in the correct `id:secret` format
  - That your Ghost site is accessible

#### 3.5 Save Changes

Click the **"Save Changes"** button to save your Ghost integration settings.

### How It Works

Once configured, here's what happens when you approve a blog post:

1. **Post Approval:** When you approve a blog post in NextBlog, the Ghost integration is triggered
2. **Native Markdown:** Ghost natively supports markdown, so your content is published exactly as written (no conversion needed!)
3. **Post Creation:** A new Ghost post is created with:
  - Title from your NextBlog post
  - Markdown content (native format)
  - Custom excerpt/description
  - SEO-friendly slug
  - Feature image (if provided)
  - Tags: "SEO" and "AI Generated"
  - Published status (based on your post status)
4. **Publishing:** The post is published to your Ghost site and is immediately live

### Troubleshooting

#### Connection Test Fails

**Common issues:**

- **Incorrect URL format:** Make sure the URL includes `https://` and doesn't have a trailing slash
- **Wrong API key format:** The Admin API Key must be in `id:secret` format with a colon. Make sure you copied both parts.
- **Invalid credentials:** Verify that the integration was created correctly in Ghost
- **Site unreachable:** Check if your Ghost site is accessible and running

#### Posts Not Publishing

**Check the following:**

- Make sure the integration is enabled in project settings
- Verify the connection test passes
- Check that you're approving posts (not just generating them)
- Look for error messages in your NextBlog dashboard
- Check Ghost admin for any failed post attempts

### Next Steps

Now that your Ghost integration is set up:

- Generate or create a blog post in NextBlog
- Review and approve the post
- Check your Ghost site - the post should appear automatically!
- Enjoy native markdown support - your content is published exactly as written
