Customizations
A church customization is one JSON file (a "pack"). In that single file you define:
- Custom fields on any ChurchApps object (people, groups, funds, donations, campaigns, events and more), under
objects.<objectType>.fields. - Every place those fields appear: badges, details and cards on record screens, inputs on edit forms, inline forms and pop-up dialogs, table columns, and buttons that open links or copy values.
Writing a pack involves no code, no deploy and no app update. You paste or upload the JSON in Settings → Customizations (or load a starter pack and edit it). B1Admin validates it with @churchapps/customizations and won't publish it until every error is fixed, reporting each one with its exact JSON path. Packs are stored in the church's database with version history and one-click rollback.
The core rule: Fields defined in JSON never appear automatically
Declaring a field in
objects.<entity>.fieldsonly creates the storage for it. Nothing shows up until you place it. Put each field explicitly wherever you want to see or edit it:
To... Place the field in... Show it on a record An overview screen slot, e.g. screens["person.overview"].slots["identity.badges"],["fund.overview"].slots["overview.details"],["group.overview"].slots["overview.sections"]Edit it with the record An edit screen slot: person.edit,person.create,group.edit,fund.edit,donation.edit,campaign.edit,task.editEdit it right on the record page A formblock inside a card, aninlineEditblock, or anopenModalaction that contains a formShow it in a list A column in tables.<tableId>, e.g.people.directory,funds.list,groups.listUse it in a link or button A {custom.<key>}template in anaction(openUrl,copyToClipboard,navigate)A field you declare but never place is stored and kept, but invisible. That's deliberate: you decide exactly what each screen shows.
This guide is self-contained: the rules, three complete examples you can copy, and a full reference of every screen, slot, table, block, input, action, icon and function. A JSON Schema for editor autocompletion is published at @churchapps/customizations/schema/customization.v1.schema.json.
Writing a pack
- Pick an id and name.
idis a permanent slug (grace-child-safety).nameis what admins see. - Declare your fields under
objects.<objectType>.fields, each with a permanentkey(bg_check_status), alabeland atype. - Place every field. For each one, decide where it's edited (an edit screen slot, or an inline
form) and where it's shown (badges, details, cards, table columns). See the table above. - Validate. Paste the JSON into Settings → Customizations → Add Pack. Errors and warnings appear as you type, each with its JSON path. You can also run
npx churchapps-customizations validate my-pack.json --strict. - Publish, then open a record to check it. Edit and republish any time; every version is kept, and History rolls back with one click. If a pack ever breaks a screen, turn on Safe Mode in Settings → Customizations to pause every pack in your browser.
Start from one of the examples below or a built-in starter pack (Load starter pack in the editor) rather than a blank file.
Using an AI assistant
Because packs follow a strict, fully documented schema, an AI assistant can write or update one for you. Give it this page (copy its text, or its address if the assistant can browse) and describe what you want in plain words, for example: "Using this guide, write a B1Admin customization pack that adds a T-shirt size field to people, lets us edit it on the person edit form, and shows it as a column in the people directory." To change an existing pack, use Download .json in Settings → Customizations and give the assistant that file too.
Paste its reply into the editor. B1Admin validates it like any other pack, so if the assistant got something wrong you'll see exactly which path to fix (or you can paste the errors back to the assistant). Remind it of the core rule if a field it declared doesn't show up anywhere.
Example 1: Background Checks
Person fields for a background check status, date and applicant id. A status badge on the person record, a button that opens the check in Protect My Ministry, a Child Safety card with an inline form to update the values, and a BG Check column in the people directory.
{
"engine": 1,
"id": "grace-background-checks",
"name": "Background Checks",
"description": "Track each person's background check, show its status, and link to Protect My Ministry.",
"version": "1.0.0",
"allowedHosts": ["app.protectmyministry.com"],
"objects": {
"person": {
"fields": [
{
"key": "bg_check_status",
"label": "Background Check",
"type": "select",
"choices": [
{ "value": "Not Started", "color": "default" },
{ "value": "Pending", "color": "warning" },
{ "value": "Cleared", "color": "success" },
{ "value": "Expired", "color": "error" }
]
},
{ "key": "bg_check_date", "label": "Background Check Date", "type": "date", "helperText": "Date the most recent check cleared" },
{ "key": "pmm_applicant_id", "label": "PMM Applicant ID", "type": "text", "validation": { "maxLength": 50 } }
]
}
},
"screens": {
"person.overview": {
"sections": { "order": ["attendance", "giving", "groups", "custom:safety"] },
"slots": {
"identity.badges": [
{
"type": "badge",
"bind": "custom.bg_check_status",
"showIf": "isNotEmpty(custom.bg_check_status)",
"colorMap": { "Cleared": "success", "Pending": "warning", "Expired": "error" }
}
],
"identity.actions": [
{
"type": "action",
"label": "View Background Check",
"icon": "VerifiedUser",
"variant": "outlined",
"action": "openUrl",
"url": "https://app.protectmyministry.com/applicants/{custom.pmm_applicant_id}",
"target": "_blank",
"showIf": "isNotEmpty(custom.pmm_applicant_id)"
}
],
"summary.top": [
{
"type": "alert",
"severity": "error",
"title": "Background Check Expired",
"text": "{person.name.first} shouldn't serve with children until a new check clears.",
"showIf": "custom.bg_check_status == 'Expired'"
}
],
"summary.sections": [
{
"id": "safety",
"type": "card",
"title": "Child Safety",
"icon": "Shield",
"children": [
{
"type": "form",
"submitLabel": "Update Screening",
"permissions": ["MembershipApi.People.Edit"],
"fields": [
{ "bind": "custom.bg_check_status", "input": "select", "grid": { "xs": 12, "sm": 4 } },
{ "bind": "custom.bg_check_date", "input": "date", "grid": { "xs": 12, "sm": 4 } },
{ "bind": "custom.pmm_applicant_id", "input": "text", "grid": { "xs": 12, "sm": 4 } }
]
}
]
}
]
}
}
},
"tables": {
"people.directory": {
"mode": "patch",
"columns": [
{
"id": "bgStatus",
"label": "BG Check",
"bind": "custom.bg_check_status",
"display": "badge",
"colorMap": { "Cleared": "success", "Pending": "warning", "Expired": "error" },
"after": "membershipStatus",
"sortable": true
},
{ "id": "bgDate", "label": "BG Check Date", "bind": "custom.bg_check_date", "display": "date", "after": "bgStatus", "defaultVisible": false }
]
}
}
}
Where each field lives:
| Field | Edited in | Shown in |
|---|---|---|
bg_check_status | The Child Safety card's form | The identity badge, the expired alert, the BG Check column |
bg_check_date | The Child Safety card's form | The BG Check Date column (off by default; users turn it on in the column picker) |
pmm_applicant_id | The Child Safety card's form | The View Background Check button's link |
Example 2: Fund GL Account Codes
Fund fields for a general-ledger code, a department and a restricted flag. Inputs on the fund edit form, a details grid and badges on the fund page, a Copy GL Code button, and three columns in the funds list.
{
"engine": 1,
"id": "grace-gl-codes",
"name": "Fund GL Account Codes",
"description": "Map each fund to a general-ledger account code and department, and flag restricted funds.",
"version": "1.0.0",
"objects": {
"fund": {
"fields": [
{
"key": "gl_account_code",
"label": "GL Account Code",
"type": "text",
"placeholder": "4010-100",
"validation": { "pattern": "^[0-9]{4}-[0-9]{3}$", "message": "Use the format 4010-100" }
},
{ "key": "department", "label": "Department", "type": "select", "choices": ["General", "Missions", "Youth", "Children", "Facilities"] },
{ "key": "restricted_fund", "label": "Restricted Fund", "type": "boolean", "defaultValue": false, "helperText": "Donor-restricted gifts" }
]
}
},
"screens": {
"fund.edit": {
"slots": {
"fields.extra": [
{ "input": "heading", "text": "Accounting" },
{ "bind": "custom.gl_account_code", "input": "text", "grid": { "xs": 12, "sm": 6 } },
{ "bind": "custom.department", "input": "select", "grid": { "xs": 12, "sm": 6 } },
{ "bind": "custom.restricted_fund", "input": "switch", "grid": { "xs": 12 } }
]
}
},
"fund.overview": {
"slots": {
"header.badges": [
{ "type": "badge", "expr": "'Restricted'", "showIf": "custom.restricted_fund == true", "defaultColor": "warning" },
{ "type": "badge", "bind": "custom.department", "showIf": "isNotEmpty(custom.department)", "defaultColor": "info" }
],
"header.actions": [
{
"type": "action",
"label": "Copy GL Code",
"icon": "ContentCopy",
"variant": "text",
"action": "copyToClipboard",
"text": "{custom.gl_account_code}",
"showIf": "isNotEmpty(custom.gl_account_code)"
}
],
"overview.details": [
{
"type": "keyValueGrid",
"columns": 3,
"items": [
{ "type": "text", "label": "GL Account Code", "bind": "custom.gl_account_code", "variant": "monospace", "emptyText": "Not set" },
{ "type": "text", "label": "Department", "bind": "custom.department", "emptyText": "Not set" },
{ "type": "boolean", "label": "Restricted", "bind": "custom.restricted_fund", "trueLabel": "Restricted", "falseLabel": "Unrestricted" }
]
}
]
}
}
},
"tables": {
"funds.list": {
"mode": "patch",
"columns": [
{ "id": "glCode", "label": "GL Code", "bind": "custom.gl_account_code", "after": "name", "sortable": true },
{ "id": "department", "label": "Department", "bind": "custom.department", "display": "badge", "defaultColor": "info", "after": "glCode", "sortable": true },
{ "id": "restricted", "label": "Restricted", "bind": "custom.restricted_fund", "display": "boolean", "trueLabel": "Restricted", "falseLabel": "", "after": "department", "align": "center" }
],
"defaultSort": { "column": "name", "direction": "asc" }
}
}
}
Example 3: Small Group Details
Group fields for a meeting room, childcare and a curriculum link. Inputs on the group edit form, a badge and a Group Details card on the group page (placed before the members list), and a Room column in the groups list.
{
"engine": 1,
"id": "grace-small-groups",
"name": "Small Group Details",
"description": "Record each small group's room, childcare and curriculum.",
"version": "1.0.0",
"objects": {
"group": {
"fields": [
{ "key": "room", "label": "Meeting Room", "type": "text", "validation": { "maxLength": 40 } },
{ "key": "childcare_provided", "label": "Childcare Provided", "type": "boolean", "defaultValue": false },
{ "key": "curriculum_url", "label": "Curriculum Link", "type": "url", "placeholder": "https://" }
]
}
},
"screens": {
"group.edit": {
"slots": {
"fields.extra": [
{ "bind": "custom.room", "input": "text", "grid": { "xs": 12, "sm": 6 } },
{ "bind": "custom.childcare_provided", "input": "switch", "grid": { "xs": 12, "sm": 6 } },
{ "bind": "custom.curriculum_url", "input": "url", "grid": { "xs": 12 } }
]
}
},
"group.overview": {
"sections": { "order": ["custom:group-details", "members"] },
"slots": {
"header.badges": [
{ "type": "badge", "expr": "'Childcare'", "showIf": "custom.childcare_provided == true", "defaultColor": "success" }
],
"overview.sections": [
{
"id": "group-details",
"type": "card",
"title": "Group Details",
"icon": "MenuBook",
"children": [
{
"type": "keyValueGrid",
"columns": 3,
"items": [
{ "type": "text", "label": "Room", "bind": "custom.room", "emptyText": "Not set" },
{ "type": "boolean", "label": "Childcare", "bind": "custom.childcare_provided", "trueLabel": "Provided", "falseLabel": "Not provided" },
{ "type": "link", "label": "Curriculum", "bind": "custom.curriculum_url", "target": "_blank", "emptyText": "None linked" }
]
}
]
}
]
}
}
},
"tables": {
"groups.list": {
"mode": "patch",
"columns": [
{ "id": "room", "label": "Room", "bind": "custom.room", "after": "name", "sortable": true }
]
}
}
}
Built-in starter packs
STARTER_PACKS ships twelve complete packs. Each validates with zero errors and zero warnings, and each places every field it declares. Load one from Load starter pack in the editor to read or adapt it:
| Pack id | What it does |
|---|---|
background-checks | Person fields bg_check_status, bg_check_date and pmm_applicant_id. Adds a status badge, conditional View and Order Background Check buttons, a renewal alert after 700 days, an inline Child Safety & Screening form card, and a BG Check column in the people directory. |
accounting-gl-codes | Fund fields gl_account_code, restricted_fund and department. Adds inputs on the fund edit form, badges and details on the fund page, and columns in the funds list. |
small-group-details | Group fields childcare_provided, curriculum_url and meeting_notes. Adds inputs on the group edit form, a badge, a copy-link button and a details card on the group page, and columns in the groups list. |
pastoral-care | Person fields baptism_date, salvation_date, care_priority and pastoral_shepherd. Adds inputs on the person edit form, a care-priority badge and a Pastoral Care card on the person page. |
kids-medical | Person fields allergies, medical_notes, emergency_contact_name, emergency_contact_relationship and emergency_contact_phone. Adds inputs on the person edit form, an Allergies badge and alert, a Call Emergency Contact button, a Medical & Emergency card, and allergy and emergency-phone columns in the people directory. |
guest-follow-up | Person fields first_visit_date, how_heard, invited_by, inviter_relationship, follow_up_status, last_contact_date and next_steps. Adds inputs on the add-person and edit forms, a Follow Up menu (call, email, and a Log Follow-Up dialog), a reminder alert, a Guest Follow-Up card, and first-visit and follow-up columns in the people directory. |
volunteer-onboarding | Person fields volunteer_skills, serving_frequency, unavailable_until, shirt_size, volunteer_orientation_date and volunteer_agreement_signed. Adds inputs on the person edit form, an onboarding progress card, a Volunteer Profile custom view with a quick-edit form, and skills and shirt-size columns in the people directory. |
membership-leadership | Person fields membership_class_date, membership_date, joined_by, previous_church, membership_certificate_url, leadership_role, leadership_term_start and leadership_term_end. Relabels the name prefix as Title, adds inputs on the person edit form, a role badge, term-ending alerts, a Membership & Leadership card, and member-since and role columns in the people directory. |
giving-statements | Person fields statement_delivery, statement_email and statement_addressee, and donation fields in_kind_item and receipt_requested. Adds inputs on the person and donation edit forms, statement preferences and donor-number actions on the person's giving page, and columns in the people directory, batch donations and person donations tables. |
batch-deposits | Donation batch fields counted_total, counted_by, verified_by, deposit_date, deposit_reference, ministry_group and reconciled. Adds a Record Count & Deposit dialog, counted/entered/difference stats and mismatch alerts on the batch page, deposit columns in the batches list, and an Offering Counting Checklist card ordered after Giving on the dashboard. |
service-plan-production | Plan fields sermon_title, sermon_series, speaker, stage_setup, livestream_url and production_notes. Adds badges, a Production Details dialog, a Sermon card with inline editing and a Production Notes card on the service plan, and sermon columns in the plans list. |
task-event-tracking | Task fields task_priority, task_category, task_acknowledged, task_reference_url and estimated_hours, and event fields setup_needs, expected_attendance, setup_lead, facility_terms_agreed, room_condition and room_condition_notes. Adds task inputs, priority badges, an inline Acknowledged switch and priority columns in the tasks list, plus a Setup & Room Check dialog, setup details, a room-condition rating and an expected-attendance stat on events. |
Rules
validateCustomizationManifest enforces all of these:
- Data, not code. No JavaScript, HTML or CSS anywhere. Every dynamic value is a sandboxed expression (
showIf,expr) or a template with{expression}parts.- Use
==and!=.===and!==are syntax errors.==is strict, except thatnulland a missing value are equal (custom.x == nullis true whenxwas never set). - No method calls. Write
lower(s), nots.toLowerCase();map(list, x => x.id), notlist.map(...). Only the built-in functions exist.
- Use
- Unknown keys are errors, everywhere. The validator suggests the closest valid key (
unknown field "colour". Did you mean "color"?). - Only catalog ids. Screen ids, slot names, section ids, table ids, built-in column ids, icons, widget/input/action types and functions must come from the catalogs. Typos are errors, not silent no-ops.
- Declare custom fields, then place them. Put each field under
objects.<objectType>.fieldsand read it ascustom.<key>. A declared field shows nowhere until a slot, form, table column or action uses it, so place every field where it's edited and where it's shown. An undeclaredcustom.<key>is a warning rather than an error, because another pack may declare it. - Field keys are permanent.
keymust match/^[a-z][a-z0-9_]*$/(e.g.bg_check_status). Values are stored by key, so renaming a key orphans existing data. Change thelabelinstead. - Safe URLs only.
openUrlactions andlink/imageurltemplates must start with a literalhttps://<host>,mailto:,tel:or an in-app/path.http://,javascript:,data:,vbscript:,file:and protocol-relative//hostare rejected. The host must be written literally (nothttps://{custom.host}/). - Allowlist external hosts. Every
https://host a template opens must be listed inallowedHostsas a bare host name ("app.protectmyministry.com", with no protocol, path or wildcard). - Every
{expression}in a URL is URL-encoded automatically. A value likea/b?cbecomesa%2Fb%3Fc, so field data can never change the destination. Don't wrap values inurlEncode()inside URL templates; that encodes them twice. - Every block has a
type, except inputs in forms. Inside a form block'sfields, and directly in edit-screen slots, an input can be written as{ "bind": "custom.key", "input": "select" }. Anywhere else, inputs must sit inside{ "type": "form", "fields": [...] }. Never put a form block on an edit screen, since it already has a form. - Choices.
selectandmultiSelectfields needchoices.select,multiSelectandradioinputs needchoicesunless they bind a select field that declares them. - Section cards need ids. A card in a section slot (e.g.
summary.sectionsonperson.overview) needs anidbeforesections.ordercan place it as"custom:<id>". - Permissions are
"<Api>.<ContentType>.<Action>"strings fromKNOWN_PERMISSIONS, e.g."MembershipApi.People.Edit". A block withpermissionsshows only to users who hold all of them. An unknown permission is a warning, since no user would hold it."MembershipApi.Domain.Admin"is expanded into the individual permissions at sign-in and never appears in a user's permissions, so use the specific one you need. - Valid
id. The packidmust match/^[a-z0-9][a-z0-9-]*$/andenginemust be1.
Top-Level Manifest (CustomizationManifest)
| Field | Required | Type | Description |
|---|---|---|---|
engine | Yes | 1 | Engine version (CUSTOMIZATION_ENGINE_VERSION). |
id | Yes | string | Pack slug, /^[a-z0-9][a-z0-9-]*$/. Stays the same across versions of the pack. |
name | Yes | string | Shown in Settings → Customizations. |
description | No | string | What the pack does. |
version | No | string | Your own label (e.g. "1.2.0"). B1Admin also numbers every published version. |
allowedHosts | No | string[] | Bare host names that https:// URL templates may open. |
objects | No | { [objectType]: { fields: CustomFieldDefinition[] } } | Custom fields per object type. |
screens | No | { [screenId]: ScreenCustomization } | Slot blocks, section layout, field overrides and custom views per screen. |
tables | No | { [tableId]: TableCustomization } | Column changes per table. |
$schema | No | string | JSON Schema URL for editors. The engine ignores it. |
Custom Fields (objects)
"objects": {
"fund": {
"fields": [
{ "key": "gl_account_code", "label": "GL Account Code", "type": "text", "validation": { "pattern": "^[0-9]{4}-[0-9]{3}$", "message": "Use ####-###" } },
{ "key": "department", "label": "Department", "type": "select", "choices": ["General", { "value": "Missions", "color": "info" }] }
]
}
}
| Field key | Required | Description |
|---|---|---|
key | Yes | Stable slug, /^[a-z][a-z0-9_]*$/. Must be unique per object type. |
label | Yes | Default label wherever the field appears. |
type | Yes | One of the field types below. |
choices | select / multiSelect | Each choice is either "Text" or { "value": "Stored", "label"?: "Shown", "color"?: "<color>" }. Values must be unique. |
placeholder, helperText | No | Input hints. |
defaultValue | No | Initial value for new records. It must match the type: a boolean, a number, a choice value, or an array for multiSelect. |
required | No | The field must be filled in on edit screens. |
validation | No | { min?, max?, minLength?, maxLength?, pattern?, message? }. pattern is regex source (no slashes) of at most 200 characters. |
permissions | No | { view?, edit? }. These are stricter than the object's default permissions and are enforced by the API. |
sort | No | Order in generic field lists. |
Field types: text, textarea, number (whole), decimal, currency, boolean, date (stored YYYY-MM-DD), dateTime, select, multiSelect, email, phone, url, rating, personRef / groupRef / fundRef (store a record id), and file.
Legacy person-field types map to these types for migration (LEGACY_PERSON_FIELD_TYPE_MAP): Textbox → text, Whole Number → number, Decimal → decimal, Date → date, Yes/No → boolean, Multiple Choice → select.
validation.pattern is a JavaScript regular expression source (no slashes or flags, at most 200 characters). Patterns that can backtrack catastrophically are rejected: a repeated group that contains another repeat or |, like (a+)+, ([a-z]+)* or (\w+\s?)+. Write ^\w+(\s\w+)*$ instead of ^(\w+\s?)+$.
Publishing a pack creates or updates its fields. They appear only where the pack places them (see the core rule). Removing a field from a pack archives the field. Its stored values are never deleted.
Screens (screens)
"screens": {
"person.overview": {
"sections": { "order": ["custom:safety", "attendance"], "hidden": ["deliveryProblems"], "labels": { "giving": "Donations" } },
"slots": { "identity.badges": [ ... ], "summary.sections": [ ... ] },
"customViews": [{ "id": "safety", "label": "Safety", "icon": "Shield", "blocks": [ ... ] }]
},
"person.edit": {
"fieldOverrides": { "person.membershipStatus": { "label": "Status" } }
}
}
slots: maps a slot name to an array of blocks. Slots that a manifest doesn't fill render nothing. See Screens, slots and sections for every slot.sections:orderlists built-in section ids andcustom:<cardId>ids in the order to show them. Sections you don't list keep their native order after the listed ones.hiddenremoves sections andlabelsrenames them. Onlyperson.overview,group.overviewanddashboardhave sections;sectionsanywhere else is an error.fieldOverrides(edit screens only, e.g.person.edit): keyed by a native field path ("person.membershipStatus") or"custom.<key>". Each override is{ hidden?, required?, readOnly?, label?, placeholder?, helperText?, defaultValue?, showIf? }. A field can't be both hidden and required. Overview screens have no native form to change, sofieldOverridesthere is an error.customViews: drill-in pages opened at?view=custom:<id>, each{ id, label, icon?, permissions?, blocks }. They're available onperson.overviewandgroup.overview.
Edit screens (person.edit, person.create, group.edit, fund.edit, donation.edit, campaign.edit, task.edit) put slot inputs inside the native form, so they save together with it. On overview screens, collect values with a form block, an inlineEdit block or an openModal action containing a form.
Blocks
Every block accepts these common keys:
| Key | Description |
|---|---|
id | Letters, digits, - and _. Must be unique within a screen. Required for cards that sections.order places. |
showIf | Expression. The block renders only when it's truthy. |
permissions | string[]. The user must hold all of them. |
grid | { xs?, sm?, md?, lg? }, each 1–12 (MUI Grid columns). |
Display widgets
{ "type": "<widget>", "bind": "<path>" } or { "type": "<widget>", "expr": "<expression>" }. Exactly one of bind and expr is required. link and image may use only url.
| Widget | Shows | Extra keys |
|---|---|---|
text | Plain text | variant: plain | bold | muted | monospace; copyable |
badge | A colored chip | colorMap (value → color), defaultColor, variant: filled | outlined |
date | A localized date | |
relativeDate | "3 days ago" / "in 2 weeks" | |
age | Age in years from a date | |
currency | A money amount | |
number | A formatted number | |
percent | Percentage points: 42 shows as 42% (not a 0–1 fraction) | |
boolean | Yes / No | trueLabel, falseLabel |
email | A mailto: link | copyable |
phone | A tel: link | copyable |
link | A link | url (URL template) or a bound url value; target |
tagList | Chips for an array or comma-separated text | colorMap, defaultColor, variant |
rating | Stars | max |
progress | A progress bar | max (default 100) |
image | An image | url or a bound value. An image address from an expr only loads from an in-app /path or an https:// host in allowedHosts. |
markdown | Rendered Markdown (sanitized) | |
entityLink | A link to a record by id | entityType (required) |
Every widget also accepts label (shown as a caption, or as the key in a keyValueGrid) and emptyText (shown when the value is empty). A file field shows as a link to the uploaded file (its default widget is link). A link that binds a url custom field (instead of a url template) opens whatever https:// address the field holds. The host allowlist applies only to URL templates written in the manifest, and B1Admin still rejects non-https values at runtime.
Colors: default, primary, secondary, success, warning, error, info.
Layout blocks
| Type | Keys | Notes |
|---|---|---|
card | title?, subtitle? (templates), icon?, children | A titled card. In a section slot, give it an id. |
grid | spacing?, children | Children use their own grid spans. |
stack | direction? (row | column), spacing?, children | |
keyValueGrid | columns? (1–4), items | items holds display widgets. Each item's label is the key. |
stat | label, bind | expr, display?, icon?, color?, helperText? | A KPI tile. |
alert | severity (success | info | warning | error), title?, text | title and text are templates. |
divider | label? |
Interactive blocks
| Type | Keys | Notes |
|---|---|---|
action | See Actions. | A button or link. |
actionGroup | label?, variant? (buttons | menu), icon?, actions | A row of buttons or a menu. |
form | title?, submitLabel?, fields | An inline form that saves the bound values of the current record. fields may contain only inputs. |
inlineEdit | bind, input?, label?, display?, choices?, validation?, colorMap?, defaultColor?, emptyText? | Shows one value with a pencil button to edit it in place. |
Inputs
{ "bind": "custom.key", "input": "<input>" } inside form.fields or an edit-screen slot. Write { "type": "input", ... } for an explicit input block.
| Key | Description |
|---|---|
input | One of the input types below. May be omitted when bind names a field declared in the pack or a native field: it then defaults by field type (boolean → switch, select → select, date → date, personRef → personLookup, ... see DEFAULT_INPUT_FOR_FIELD_TYPE). Required for heading, divider, infoText and undeclared fields. |
bind | The value path the input edits: custom.<key> or an editable native field such as person.contactInfo.email. Not used by heading, divider or infoText. Read-only native fields can't be bound. |
label, placeholder, helperText, choices, validation, required, defaultValue | Default to the bound field's definition. |
readOnly, showIf, permissions, grid | |
text | Template for heading and infoText, or the full consent wording of a consentCheckbox (separate from its short label). |
min, max, step | For number, slider and rating. |
Input types: text, textarea, number, decimal, currency, email, phone, url, markdown, select, multiSelect, radio, checkbox, switch, yesNo, consentCheckbox, date, dateTime, rating, slider, color, file, campusSelect, personLookup, groupLookup, fundLookup, and the layout-only heading, divider and infoText.
An input that doesn't suit its field's type is a warning, for example a date input bound to a boolean field. Booleans take switch, checkbox, yesNo, consentCheckbox, select or radio. personRef fields take personLookup, groupRef takes groupLookup, and fundRef takes fundLookup.
Actions (Links & Buttons)
{
"type": "action",
"label": "View Background Check",
"icon": "VerifiedUser",
"variant": "outlined",
"color": "primary",
"action": "openUrl",
"url": "https://app.protectmyministry.com/applicants/{custom.pmm_applicant_id}",
"target": "_blank",
"showIf": "isNotEmpty(custom.pmm_applicant_id)",
"permissions": ["MembershipApi.People.View"],
"confirm": { "title": "Leave B1Admin?", "message": "Open {person.name.display} in PMM?", "confirmLabel": "Open" }
}
action | Required keys | Behavior |
|---|---|---|
openUrl | url | Fills the URL template (every {expr} is URL-encoded), checks it with isSafeActionUrl, and opens it. target is _blank (opened with rel="noopener noreferrer") or _self. |
navigate | to | In-app navigation to a path template that starts with a single /, e.g. "/people/{person.id}?view=custom:safety". |
copyToClipboard | text | Copies the filled template and shows a confirmation. |
openModal | modal: { title, maxWidth?, blocks } | Opens a dialog with any blocks, including a form. |
startWorkflow | workflowId | Enrolls the current person in a workflow. Works on person screens and tables only. |
triggerWebhook | webhookKey | Sends a customization.action event with the current record to the webhook whose id or name is webhookKey (Settings → Developer → Webhooks). It runs through the server, so no secrets reach the browser. It needs a record, so it isn't allowed on dashboard. |
Other keys: variant (contained | outlined | text | link | icon; icon requires icon), color (primary | secondary | success | warning | error | info | inherit), icon (from Icons), and confirm ({ title, message, confirmLabel? }, where message is a template). A key that belongs to a different action type is an error, e.g. to on an openUrl.
URL rules:
| URL starts with | Allowed? |
|---|---|
https://<literal host> | Yes, if the host is in allowedHosts |
mailto:, tel: | Yes |
/path (in-app) | Yes |
{expression} (no literal prefix) | No. The destination can't be checked. |
https://{expression} | No. The host must be literal. |
http://, //host, javascript:, data:, vbscript:, file:, anything else | No |
Anything containing \ (e.g. /\evil.com, /foo\bar) | No. Browsers read \ as /. |
https://user:pass@host | No |
Tables (tables)
"tables": {
"funds.list": {
"mode": "patch",
"columns": [
{ "id": "glCode", "label": "GL Code", "bind": "custom.gl_account_code", "after": "name", "sortable": true },
{ "id": "restricted", "label": "Restricted", "bind": "custom.restricted_fund", "display": "boolean", "after": "glCode" },
{ "id": "taxDeductible", "label": "Tax Status" }
],
"defaultSort": { "column": "name", "direction": "asc" },
"rowActions": [
{ "type": "action", "label": "Ledger", "icon": "Receipt", "variant": "icon", "action": "navigate", "to": "/donations/funds/{row.id}" }
]
}
}
mode: "patch"(the default) keeps the built-in columns. List a built-in column id to override itslabel,display,width,align,sortableorhidden, or to move it. List a new id withbindorexprto add a column. New columns are added before the trailing system columns (edit,actions,deleteOption) unlessbefore/afterplaces them. Moves run in list order and may reference columns added later in the list.mode: "replace"shows exactly the listed columns in the listed order. A listed built-in id keeps its native rendering.beforeandafterare ignored.- Column keys:
id,label,bind|expr,display(any display widget; defaults to the bound field's widget, so a boundselectis abadgeand a boundbooleanisboolean),colorMap/defaultColor(badge/tagList),url+target(link),trueLabel/falseLabel(boolean),max(rating/progress),entityType(entityLink),width(pixels or a CSS length such as"120px"or"15%"),align(left|center|right),sortable,hidden(removed entirely),defaultVisible(falsemeans it's offered in the column picker but off by default),before/after,permissions, andexportable(included in CSV export; the default is true). - Row scope:
row(and the object name, e.g.person, which is the same record),custom(the row's custom values),userandchurch. - Users can still show and hide columns themselves. Reset to church default returns them to the manifest's layout.
Expressions & Templates
Names in scope
| Where | Names |
|---|---|
Screen with a record (e.g. person.overview) | <objectType> (e.g. person), custom, user, church |
dashboard | user, church |
Tables (columns, rowActions) | row, <objectType>, custom, user, church |
user is the signed-in user (user.id, user.firstName, user.lastName, user.email, user.personId). church is the current church (church.id, church.name, church.subDomain). Reading an unknown name is an error. Reading an unknown native path (e.g. person.contactInfo.emial) is a warning.
Syntax
- Literals:
'text',"text",12,1.5,true,false,null, arrays[a, ...b]and objects{ a: 1, ...c }. - Paths:
person.name.first,custom.bg_check_status,row['id'],items[0]. - Operators:
!, unary-,*,/,%,+(adds numbers, otherwise joins text),-,<,>,<=,>=,==,!=,&&,||,??,? :, and parentheses.<,>,<=and>=arefalsewhen either side is empty (null, missing,''), soage(person.birthDate) < 18is false for someone without a birth date. - Lambdas:
x => x.idand(x, i) => i. They work only as arguments tomap,filterandfind. - Not allowed:
===,!==,=, method calls,__proto__,prototypeandconstructor. Expressions are limited to 200 levels of nesting and 2,000 characters. - Every evaluation has a budget: 10,000 steps, 200 levels of nesting at run time (including recursion through lambdas), 50,000 characters of built text and 5,000-item lists. An expression that exceeds it fails, which hides a
showIfblock instead of freezing the screen.
Templates
Text props embed expressions in braces: "Last cleared on {formatDate(custom.bg_check_date)}.". These props are templates: alert title and text, card title and subtitle, stat helperText, the text of heading / infoText / copyToClipboard, modal title, confirm message, url and to. Missing values render as empty text. In url and to, every value is URL-encoded.
Built-in functions
| Function | Description |
|---|---|
daysSince(date) | Whole days from date until today (null if empty). |
daysUntil(date) | Whole days from today until date. |
age(date) | Whole years since date, e.g. age(person.birthDate). null if empty, invalid or in the future. |
yearsSince(date) | Whole years elapsed since date, e.g. yearsSince(custom.baptism_date). null if empty; negative for future dates. |
today() | Today's local date as 'YYYY-MM-DD'. |
formatDate(date, format?) | short (default), long, iso, monthDay, monthYear or dateTime. YYYY-MM-DD values (and the API's midnight-UTC form, YYYY-MM-DDT00:00:00.000Z) are local dates, so they never shift a day. |
formatCurrency(amount, code?) | e.g. $1,234.50 (default USD). |
formatNumber(n, decimals?) | e.g. 1,234. |
lower(s), upper(s), trim(s) | Text case and whitespace. |
concat(a, b, ...) | Joined text. If the first argument is an array, returns one combined array. |
coalesce(a, b, ...) | The first value that isn't null, missing or ''. |
includes(listOrText, value) | Membership or substring test. |
len(v) | Length of a list or text, or the number of keys in an object. List functions also accept a JSON-encoded list such as a raw multiSelect value '["a","b"]'. |
map(list, x => ...), filter(list, x => ...), find(list, x => ...) | List helpers. find returns null when nothing matches. |
join(list, sep?), split(text, sep?) | The default separator is ', ' for join and ',' for split (parts are trimmed). |
replace(text, search, replacement) | Replaces every occurrence. Plain text, not regex. |
startsWith(text, prefix), endsWith(text, suffix) | |
abs(n), round(n, decimals?), min(...), max(...) | min and max also accept a list. |
toNumber(v), toString(v) | toNumber returns null when the value isn't a number. toString turns null into ''. |
urlEncode(v) | encodeURIComponent. Not needed inside URL templates. |
isEmpty(v), isNotEmpty(v) | Empty means null, missing, blank text, [] or {}. |
Common patterns
isNotEmpty(custom.pmm_applicant_id)
custom.bg_check_status == 'Cleared' && daysSince(custom.bg_check_date) > 700
includes(['High', 'Urgent'], custom.care_priority)
coalesce(person.name.nick, person.name.first) + ' ' + person.name.last
custom.restricted_fund ? 'Restricted' : 'Unrestricted'
Combining Packs
A church can enable several packs, for example Background Checks, Accounting GL Codes and a church-specific overrides pack. mergeCustomizationManifests combines them in their stored order, and later packs win conflicts:
allowedHostsare combined (union).- Fields merge by
key, with the later definition replacing the earlier one. - Slots concatenate: each pack's blocks are appended.
sections: a laterorderreplaces an earlier one,hiddenlists are combined, andlabelsmerge.fieldOverridesmerge property by property.customViewsmerge byid.- Tables in
patchmode compose column by column, so a later pack can hide or move a column an earlier pack added. A laterreplacetable discards earlier columns.defaultSorttakes the last value given.rowActionsaccumulate and are replaced byid.
Catalogs
Objects and native fields
| Object type | Label | Default view / edit permission | Native fields (* = read-only) |
|---|---|---|---|
person | Person | MembershipApi.People.View / MembershipApi.People.Edit | person.id, person.name.display, person.name.first, person.name.middle, person.name.last, person.name.nick, person.name.prefix, person.name.suffix, person.contactInfo.email, person.contactInfo.workEmail, person.contactInfo.mobilePhone, person.contactInfo.homePhone, person.contactInfo.workPhone, person.contactInfo.address1, person.contactInfo.address2, person.contactInfo.city, person.contactInfo.state, person.contactInfo.zip, person.membershipStatus, person.gender, person.birthDate, person.maritalStatus, person.anniversary, person.photo, person.householdId, person.householdRole, person.campusId, person.school, person.grade, person.graduationDate, person.employer, person.nametagNotes, person.donorNumber, person.inactiveReason, person.inactiveDate, person.optedOut, person.child, person.dateAdded, person.userId* |
household | Household | MembershipApi.People.View / MembershipApi.People.Edit | household.id*, household.name |
group | Group | MembershipApi.People.View / MembershipApi.Groups.Edit | group.id, group.name, group.categoryName, group.memberCount, group.about, group.photoUrl, group.tags, group.meetingTime, group.meetingLocation, group.campusId, group.joinPolicy, group.trackAttendance, group.parentPickup, group.printNametag, group.capacity, group.minGrade, group.maxGrade, group.archived*, group.confidential, group.slug |
groupMember | Group Member | MembershipApi.Group Members.View / MembershipApi.Group Members.Edit | groupMember.id, groupMember.personId, groupMember.groupId, groupMember.leader, groupMember.joinDate, groupMember.person.name.display, groupMember.person.contactInfo.email, groupMember.person.contactInfo.mobilePhone |
fund | Fund | GivingApi.Donations.View / GivingApi.Donations.Edit | fund.id*, fund.name, fund.description, fund.taxDeductible, fund.visible |
donation | Donation | GivingApi.Donations.View / GivingApi.Donations.Edit | donation.id, donation.batchId, donation.personId, donation.donationDate, donation.amount, donation.currency, donation.method, donation.methodDetails, donation.notes, donation.memo, donation.status, donation.person.name.display |
donationBatch | Donation Batch | GivingApi.Donations.View / GivingApi.Donations.Edit | donationBatch.id, donationBatch.name, donationBatch.batchDate, donationBatch.status, donationBatch.closedDate, donationBatch.donationCount, donationBatch.totalAmount |
campaign | Campaign | GivingApi.Donations.View / GivingApi.Donations.Edit | campaign.id*, campaign.fundId, campaign.name, campaign.description, campaign.goalAmount, campaign.startDate, campaign.endDate, campaign.showPublic, campaign.allowSelfPledge |
event | Event | ContentApi.Content.Edit / ContentApi.Content.Edit | event.id, event.groupId, event.title, event.description, event.start, event.end, event.allDay, event.visibility, event.registrationEnabled, event.capacity, event.waitlistEnabled, event.registrationOpenDate, event.registrationCloseDate, event.tags, event.photoUrl |
plan | Plan | MembershipApi.Plans.Edit / MembershipApi.Plans.Edit | plan.id, plan.name, plan.ministryId, plan.campusId, plan.serviceDate, plan.notes, plan.signupDeadlineHours, plan.showVolunteerNames |
task | Task | DoingApi.Tasks.View / DoingApi.Tasks.Edit | task.id, task.taskNumber, task.taskType, task.title, task.status, task.dateCreated, task.dateClosed, task.dueDate, task.associatedWithType, task.associatedWithId, task.associatedWithLabel, task.assignedToType, task.assignedToId, task.assignedToLabel, task.createdByLabel |
song | Song | MembershipApi.Plans.Edit / ContentApi.Content.Edit | song.id*, song.title, song.artist, song.album, song.language, song.releaseDate, song.seconds, song.thumbnail |
campus | Campus | MembershipApi.People.View / MembershipApi.Settings.Edit | campus.id*, campus.name, campus.address1, campus.address2, campus.city, campus.state, campus.zip, campus.timezone, campus.website |
Screens, slots and sections
| Screen id | Screen | Record | Edit screen | Slots | Built-in sections |
|---|---|---|---|---|---|
person.overview | Person record | person | No | identity.header — Under the person's name in the identity cardidentity.badges — Chips beside the membership status in the identity cardidentity.details — Extra rows in the identity card's contact detailsidentity.actions — Buttons at the bottom of the identity cardsummary.top — Above the summary cards (alerts, banners)summary.sections (section slot) — Cards among the summary sections; give each card an id to order it with custom:<id>summary.bottom — Below the summary cards | attendance, giving, groups, notes, deliveryProblems, documents, forms, requests, tasksSupports customViews |
person.edit | Edit person | person | Yes | before.name — Inputs above the name fieldsafter.contact — Inputs after the contact fieldsafter.demographics — Inputs after membership status, birth date, gender and other demographicscustom.sections — Extra cards of inputs at the end of the formactions — Buttons beside Save / Cancel | — |
person.create | Add person | person | Yes | fields.extra — Inputs after the built-in name and email fields | — |
person.giving | Person giving | person | No | header.actions — Buttons in the giving headersummary.top — Above the donation listsummary.bottom — Below the donation list | — |
group.overview | Group record | group | No | header.badges — Chips beside the record titleheader.actions — Buttons in the record headeroverview.top — Above the group overviewoverview.sections (section slot) — Cards among the overview sections; give each card an id to order it with custom:<id>overview.bottom — Below the group overview | members, sessions, calendar, health, notesSupports customViews |
group.edit | Edit group | group | Yes | fields.extra — Inputs after the built-in group fieldscustom.sections — Extra cards of inputs at the end of the form | — |
fund.overview | Fund record | fund | No | header.badges — Chips beside the record titleheader.actions — Buttons in the record headeroverview.top — Above the fund's donationsoverview.details — Key/value details under the fund nameoverview.bottom — Below the fund's donations | — |
fund.edit | Edit fund | fund | Yes | fields.extra — Inputs after the built-in fund fields | — |
donationBatch.overview | Donation batch | donationBatch | No | header.actions — Buttons in the batch headersummary.top — Above the batch's donationssummary.bottom — Below the batch's donations | — |
donation.edit | Edit donation | donation | Yes | fields.extra — Inputs after the built-in donation fields | — |
campaign.overview | Campaign record | campaign | No | header.badges — Chips beside the record titleheader.actions — Buttons in the record headeroverview.top — Above the pledge progressoverview.bottom — Below the pledge progress | — |
campaign.edit | Edit campaign | campaign | Yes | fields.extra — Inputs after the built-in campaign fields | — |
plan.overview | Service plan | plan | No | header.badges — Chips beside the record titleheader.actions — Buttons in the record headeroverview.top — Above the plan's items and teamsoverview.bottom — Below the plan's items and teams | — |
task.overview | Task | task | No | header.badges — Chips beside the record titleheader.actions — Buttons in the record headerdetails.extra — Extra rows in the task detailsoverview.bottom — Below the task conversation | — |
task.edit | Edit task | task | Yes | fields.extra — Inputs after the built-in task fields | — |
dashboard | Dashboard | — | No | top — Above the dashboard cardssections (section slot) — Cards among the dashboard cards; give each card an id to order it with custom:<id>bottom — Below the dashboard cards | plans, tasks, groups |
event.overview | Event | event | No | header.actions — Buttons in the event headerdetails.extra — Extra rows in the event detailsoverview.bottom — Below the event details | — |
registrations.overview | Event registrations | event | No | header.actions — Buttons in the registrations headersummary.top — Above the registration listsummary.bottom — Below the registration list | — |
Only screens with built-in sections (or a section slot) accept sections; on the others it's an error rather than a silent no-op.
Tables
| Table id | Table | Rows | Built-in column ids |
|---|---|---|---|
people.directory | People directory | person | photo, displayName, lastName, firstName, middleName, address, city, state, zip, email, phone, birthDate, birthDay, age, gender, grade, school, membershipStatus, donorNumber, campus, maritalStatus, anniversary, nametagNotes, dateAdded, deleteOption |
groups.list | Groups | group | name, memberCount, actions |
group.members | Group members | groupMember | photo, name, leader, email, phone, actions |
funds.list | Funds | fund | name, taxDeductible, edit |
fund.donations | Fund donations | donation | date, donor, batch, amount |
donations.batches | Donation batches | donationBatch | name, batchDate, donationCount, totalAmount, status, edit |
donations.batchItems | Batch donations | donation | donor, date, method, memo, notes, amount, edit |
person.donations | Person donations | donation | date, batch, method, fund, notes, amount |
campaigns.list | Campaigns | campaign | name, fund, startDate, goal, pledged, given, progress, edit |
tasks.list | Tasks | task | title, associatedWith, assignedTo, opened, status |
plans.list | Service plans | plan | name, serviceDate, serviceOrder, actions |
registrations.list | Event registrations | event | name, email, status, registeredDate, actions |
Icons
Add, Assignment, AttachMoney, AutoAwesome, Badge, Block, Bolt, Bookmark, Cake, CalendarMonth, Call, Campaign, CheckCircle, ChildCare, Church, Close, Cloud, ContentCopy, CreditCard, Delete, Description, Download, Edit, Email, Error, Event, Favorite, Flag, Folder, Group, Groups, Handshake, Help, History, Home, Info, Label, Launch, Link, LocalHospital, LocationOn, Lock, MenuBook, Message, MusicNote, Notes, Notifications, OpenInNew, People, Person, Phone, Print, Receipt, Schedule, School, Search, Security, Send, Settings, Share, Shield, Star, Sync, Task, ThumbUp, Upload, VerifiedUser, Visibility, VolunteerActivism, Warning, Webhook, Work
Validating & Testing
Validate before publishing (or before handing AI-written JSON to an admin). Fix every error (publishing is blocked) and every warning.
# CLI (installed with the package)
npx churchapps-customizations validate my-pack.json # human-readable, exits 1 on errors
npx churchapps-customizations validate my-pack.json --strict # also fails on warnings
npx churchapps-customizations validate my-pack.json --json # full result + impact summary
import { validateCustomizationManifest, summarizeManifestImpact } from "@churchapps/customizations";
const result = validateCustomizationManifest(JSON.parse(text));
// { valid, errors: [{ path, message, severity }], warnings: [...] }
for (const e of result.errors) console.log(`${e.path}: ${e.message}`);
// e.g. screens['person.overview'].slots['identity.actions'][0].url: host "evil.com" isn't in allowedHosts; add "evil.com" to the manifest's "allowedHosts"
console.log(summarizeManifestImpact(manifest, previousVersion).summaryLines);
// ["+3 custom fields on Person", "Customizes Person record (10 blocks in 4 slots, section layout)", "People directory table: +2 columns", ...]