This guide walks you through adding the Outpost integration files to your Ghost theme. Once complete, your theme will load the Outpost script on every page, enabling CTAs, paywalls, member tracking, and other Outpost features. Optionally, you can also add Contextly content recommendation modules at the same time.Documentation Index
Fetch the complete documentation index at: https://documentation.outpost.pub/llms.txt
Use this file to discover all available pages before exploring further.
If you’re using the Theme Connect Wizard in Outpost, these steps are handled automatically. This guide is for publishers who prefer to update their theme manually or need to troubleshoot a custom integration.
Prerequisites
- An active Outpost account on the Voyager or Luna plan
- Access to your Ghost theme files (via GitHub or download/upload)
- Your Outpost embed API key and Outpost domain name (found in Account > Core Connections in the Outpost admin). This embed key is the per-blog public key the theme uses to load the Outpost script — it is not the same as the Integration API key used by the Integration API.
- A Contextly for Ghost account (optional, for content recommendations)
Integration files
The starter kit provides apartials/integrations folder with these files:
| File | Purpose |
|---|---|
outpost.hbs | Loads the Outpost script on every page |
outpost-api-key.hbs | Stores your Outpost embed API key (the per-blog public key, distinct from the Integration API key) |
outpost-domain-name.hbs | Stores your Outpost domain name |
contextly.hbs | Loads the Contextly script (optional) |
contextly-module.hbs | Renders the Contextly recommendation widget in posts (optional) |
contact-form.hbs | Renders an Outpost contact form (optional) |
Setup instructions
Choose the method that matches how you manage your theme:- Download / Upload
- GitHub
Step 1: Download the files
Download the Outpost Theme Integration Kit from GitHub and unzip it.Download your current theme from Ghost and unzip it. We recommend keeping a backup copy of the original.Step 2: Copy the integration partials
Copy thepartials/integrations folder from the starter kit into the partials folder of your theme.Your theme’s file structure should look like:Step 3: Add your Outpost API key
- Open
partials/integrations/outpost-api-key.hbsin a text editor - Go to your Outpost admin → Account → Core Connections
- Copy your Outpost embed API key
- Replace
Sample_Outpost_API_Keywith your key - Make sure there are no extra lines or spaces in the file
- Save
Step 4: Add your Outpost domain name
- Open
partials/integrations/outpost-domain-name.hbsin a text editor - From the same Core Connections page, copy your Outpost Domain Name
- Replace
examplewith your domain name - Make sure there are no extra lines or spaces in the file
- Save
Step 5: Add the Outpost script to default.hbs
Open your theme’sdefault.hbs file and add the following code directly below {{ghost_foot}}:If you are not using Contextly, omit the
{{> integrations/contextly}} line.Step 6: Add Contextly recommendations to posts (optional)
To display the Contextly recommendation widget at the end of your posts, openpost.hbs (or your theme’s post template) and add the following code after the {{content}} section, before comments or the author bio:Step 7: Upload to Ghost
Zip your theme folder, then upload it in Ghost Admin → Settings → Design → Change theme → Upload.Verifying the integration
After activating the updated theme:- Visit a post on your site and view the page source — you should see the Outpost script loading
- Outpost features like CTAs, paywalls, and member tracking should begin working immediately
- If using Contextly, recommendations should appear within 10 minutes. If they don’t, log into Contextly → Recommendations → Refresh All
Troubleshooting
Outpost features aren't loading
Outpost features aren't loading
- Verify your embed API key in
outpost-api-key.hbshas no extra spaces or newlines - Confirm the
{{> integrations/outpost}}partial is included indefault.hbsafter{{ghost_foot}} - Check your browser’s developer console for JavaScript errors
Contextly recommendations don't appear
Contextly recommendations don't appear
- Wait 10 minutes after activating the theme
- Log into Contextly and go to Recommendations → Refresh All
- Verify the
{{> integrations/contextly-module}}partial is placed after{{content}}in your post template
GitHub web editor adds unwanted whitespace
GitHub web editor adds unwanted whitespace
Edit the embed API key and domain name files locally rather than through GitHub’s web editor, which sometimes adds trailing newlines.
Related resources
Theme Connect Wizard
Let Outpost update your theme automatically instead of editing files manually.
Integration Kit on GitHub
Download the starter kit with all integration partial files.
Contact Support
Contact the Outpost team for help with theme integration.

