This extension provides additional iframes which can be used to embed churchtools information into restricted websites e.g. https://www.gemeindebaukasten.de/ used in ELKW.
In order to use this extension without user login - (embed on public web pages)
- Create a user "ct-iframes-tech-user" and set password to "A1!" (replace with your own base URL inlcuding https:// and no / at end) This user will automatically be created if login with this configuration is not possible. Password needs to be set manually!
- Make sure "view", "view custom category" and "view custom data" permission are allowed for this user - NO Other rights should be available - not even show persons ...
- Allow full access to the user who should be used to display the information - NOT the tech user it might be better to use a dedicated user which only has access to the information required.
- Open the extension in ChuchTools Web View and "Share current user login"
WARNING - sharing the user token technically allows anybody with access to this token to make changes on behalf of this person. Please be aware that this might compromise your security as the tech user setup is the same for all instances unless changed manually in the code. It is strongly adivsed to use a seperate user with minimal permissions - USE WITH CAUTION !
This extension uses a saved login token. After each execution a logout is performed because otherwise any user might be able to act on behalf of the user providing the token.
WARNING - if the execution of scripts is stopped before end of script users might still be logged in.
modifying each view is achieved by passing respective GET params listed in the description
in KV Store will be used to store login token
each entry is used as a CSS style inserted into the document #app is added befor each selector to limit the style to the app itself
if category does not exist it will be created upon first load.
e.g.
{
"selector": "#dateHeader",
"property": "background-color: #ffd800;"
}
or
{
"selector": "ul li:nth-child(odd)",
"property": "background-color:#f2f2f2;"
}
Feel free to use developer console to check which css ids and classes are provided for each view
Issues with login / permissions or similar are logged on JS Console - if anything does not work as expected try to use developer tools console to read these messages.
make sure you have an .env file with VITE_BASE_URL and VITE_KEY
Start a development server with hot-reload:
npm run devNote: For local development, make sure to configure CORS in your ChurchTools instance to allow requests from your local development server (typically
http://localhost:5173). This can be done in the ChurchTools admin settings under: "System Settings" > "Integrations" > "API" > "Cross-Origin Resource Sharing"If login works in Chrome but not in Safari, the issue is usually that Safari has stricter cookie handling:
- Safari blocks
Secure; SameSite=Nonecookies onhttp://localhost(Chrome allows them in dev).- Safari also blocks cookies if the API is on another domain (third‑party cookies).
Fix:
- Use a Vite proxy so API calls go through your local server (
/api → https://xyz.church.tools). This makes cookies look first‑party.- Run your dev server with HTTPS. You can generate a local trusted certificate with mkcert.
With proxy + HTTPS, Safari will accept and store cookies just like Chrome.
To create a production build:
npm run buildTo preview the production build locally:
npm run previewTo build and package your extension for deployment:
npm run deployThis command will:
- Build the project
- Package it using the
scripts/package.jsscript
You can find the package in the releases directory.
Following endpoints are available. Permissions are possible per route. Types are documented in ct-types.d.ts (CustomModuleCreate, CustomModuleDataCategoryCreate, CustomModuleDataValueCreate)
GET /custommodules get all extensions
GET /custommodules/{extensionkey} get an extensions by its key
GET /custommodules/{moduleId} get an extension by its ID
GET /custommodules/{moduleId}/customdatacategories
POST /custommodules/{moduleId}/customdatacategories
PUT /custommodules/{moduleId}/customdatacategories/{dataCategoryId}
DELETE /custommodules/{moduleId}/customdatacategories/{dataCategoryId}
GET /custommodules/{moduleId}/customdatacategories/{dataCategoryId}/customdatavalues
POST /custommodules/{moduleId}/customdatacategories/{dataCategoryId}/customdatavalues
PUT /custommodules/{moduleId}/customdatacategories/{dataCategoryId}/customdatavalues/{valueId}
DELETE /custommodules/{moduleId}/customdatacategories/{dataCategoryId}/customdatavalues/{valueId}
For questions about the ChurchTools API, visit the Forum.