Embeds
Install a ChurchKit embed, style it, and control where it can load.
A ChurchKit embed is a small script that renders live Planning Center content into a container on your page. Church staff create the embed in ChurchKit; you install the code they give you.
The embed code
Staff copy the embed code from the embed's Settings tab. It looks like this:
<div id="ck-embed-EMBED_ID"></div>
<script
src="https://churchkit.io/embed.js"
data-token="ACCESS_TOKEN"
data-container="ck-embed-EMBED_ID"
data-type="calendar"
></script>| Attribute | Required | Description |
|---|---|---|
data-token | Yes | The embed's access token. |
data-container | Yes | The id of the element to render into. |
data-type | No | The embed type, used as a hint while the embed loads. |
Paste it where you want the content to appear. Keep the <div> before the <script>:
the container must already be on the page when the script runs.
How it renders
- The embed renders straight into your page, not in an iframe, so it fills the width of its container and grows to fit its content. Size it by sizing the container.
- YouTube embeds include a YouTube player iframe.
- The access token is visible in your page source. That's expected: it only allows what this embed does, such as reading the data it shows.
- If staff click Regenerate Token, the old token stops working. Replace the code everywhere it's installed.
More than one embed on a page
The script reads the most recent <script data-token> tag on the page when it runs.
Paste each embed's code as-is, as ordinary script tags (not async or defer), and
each one renders into its own container.
Styling
Staff choose a style mode on the embed's Design → Style tab:
| Mode | What it does |
|---|---|
| Default (inherits page styles) | ChurchKit's built-in layout, picking up your page's styles. |
| Custom Colors & Fonts | Set background, card background, text, secondary text, border, and accent colors, a font, and a border radius. |
| Unstyled (CSS class names) | Minimal built-in styles. You style the embed with your own CSS. |
With Custom Colors & Fonts, the font is applied by name only. Make sure your site loads that font.
CSS class names
In Unstyled mode, target the embed's ck-embed-* classes from your stylesheet. The
full list, with a description of each class, is shown on the Style tab when
Unstyled (CSS class names) is selected. Common ones:
| Class | Element |
|---|---|
ck-embed | Root container |
ck-embed-toolbar | Row holding the search bar and view switcher |
ck-embed-search-input | Search input |
ck-embed-filters | Visitor filter controls |
ck-embed-filter-select | A filter dropdown |
ck-embed-grid | Card grid layout |
ck-embed-card | A single card |
ck-embed-calendar | Calendar month layout |
ck-embed-list | Calendar list layout |
ck-embed-empty | "No results" message |
.ck-embed-card {
border: 1px solid #e5e5e5;
border-radius: 12px;
}Which filters visitors can use is set per embed on the Design → Filters tab.
Allowed origins
By default, any website can load an embed. To limit it to your own sites, staff enter them in Allowed origins, in the Origin access card on the embed's Settings tab:
- One origin per line, with the scheme and host only, like
https://www.example.org. No paths and no wildcards. Up to 32 origins. - Origins must match exactly. If your site loads on both
https://example.organdhttps://www.example.org, list both. - Once the list is saved, the Current policy shows Restricted and requests from any other site are refused.
- Clearing the list and saving returns the embed to Any origin (legacy), so every website can load it again. To keep an embed restricted, leave at least one origin in the list.
Allowed origins also applies to the Data API.
Content Security Policy
If your site sends a Content Security Policy, it needs to allow ChurchKit. We recommend starting with:
script-src https://churchkit.ioconnect-src https://churchkit.iostyle-src 'unsafe-inline', because embeds style themselves with inline<style>blocks andstyleattributes, and the script doesn't support nonces. Without it, embeds render unstyled.frame-src https://www.youtube.comfor YouTube embeds
Images in embeds (such as group and event photos) load from Planning Center's image
hosts, so your img-src needs to allow them. Check your browser console for blocked
requests to find the exact hosts.