@apollosproject/web-embeds
v0.1.8
Published
Next-generation embeddable widget system for Apollos
Readme
Apollos Web Embeds v2
Next-generation embeddable widget system for Apollos that enables churches to provide their congregation with instant access to church resources, AI-powered search, and key actions directly from their website.
Quick Start
Installation
Add the following script tag before the closing </body> tag:
<script>
(function (w, d, s, o, f, js, fjs) {
w["ApollosEmbed"] = o;
w[o] =
w[o] ||
function () {
(w[o].q = w[o].q || []).push(arguments);
};
js = d.createElement(s);
fjs = d.getElementsByTagName(s)[0];
js.id = o;
js.src = f;
js.async = 1;
fjs.parentNode.insertBefore(js, fjs);
})(
window,
document,
"script",
"apollos",
"https://embed.apollos.com/v2/embed.js"
);
apollos("init", {
slug: "your-church-slug",
});
</script>Link Interception (Primary Use Case)
The simplest way to use the embed is through automatic link interception. Any link on your website pointing to your church's Apollos URL will automatically open in the embed:
<a href="https://apollos.com/your-church/give">Give Now</a>
<a href="https://apollos.com/your-church/events">View Events</a>Development
# Install dependencies
npm install
# Start dev server (runs inject-config first, then Vite)
npm run dev
# Build for production
npm run buildCrossroads test page
The public/crossroads-test/ directory contains a demo giving page. The embed base URL and church slug are configurable via env vars:
- Local dev: Create
.envinapps/web-embeds-v2/(see.env.example). Runnpm run inject-configornpm run devto generateindex.htmlfrom the template. - GitHub Pages: Set
APOLLOS_EMBED_BASE_URLandAPOLLOS_EMBED_CHURCH_SLUGin repo Settings → Variables and secrets → Actions. The workflow deploys on push tomainwhen crossroads-test files change. Enable Pages in Settings → Pages → Source: GitHub Actions.
Publishing
This app publishes to the npm package @apollosproject/web-embeds (separate from @apollosproject/canvas-embeds).
CDN URL:https://cdn.jsdelivr.net/npm/@apollosproject/web-embeds@latest/widget/embed.js
Automatic deploy
On push to main, the GitHub workflow syncs the published version from npm (if any), bumps the version (patch by default), runs npm publish (which triggers prepublishOnly to build), and purges the jsDelivr cache for @apollosproject/web-embeds.
Manual deploy
From the repo root (after yarn install):
cd apps/web-embeds-v2- Optionally sync to the last published version:
yarn version --immediate "$(npm show @apollosproject/web-embeds version)" - Bump the version:
yarn bump(patch by default, oryarn bump:prereleasefor prerelease) - Publish:
npm publish(runsprepublishOnlyto build and verify) - Purge jsDelivr cache:
yarn flush
Skipping the publish step means users will still get the previous version; skipping the flush step delays propagation until jsDelivr’s cache expires.
Documentation
See the full Product Requirements Document for detailed specifications.
License
MIT
