Falaah Falaah AI

Embedding Muin on Your Site

Drop a Muin smart form, donation page, giving page, or kiosk into any third-party site with one short snippet that sizes itself, no SDK, API key, or CORS setup.

Any Muin public surface under /go/* or /embed/* can be embedded on a third-party site. The snippet the app gives you is a script tag plus a placeholder <div>; the script puts the page in a frame that grows to the page’s own height, so nothing scrolls inside a fixed box. There is no SDK, no API key, and no CORS preflight to configure: the response headers do the work.

Get your snippet from the app

You do not have to assemble any of this by hand. Open the page in Muin and choose Share, or go to Public → Pages and open Embed & Share. It asks one question first, On my own website (“Paste a small piece of code into your site so people give without leaving it.”) or I’ll share a link (“Send a web address by email, social media, or a QR code.”), and then asks which page the snippet should open, because “Every snippet points at one specific page. We never guess.”

The recommended shape is marked Recommended; More options opens the rest. Copy code puts the snippet on your clipboard, and an install guide walks through pasting it into the common website builders.

Until you pick a page, the code box says “Pick a page above and your code will appear here.” If you have no published pages yet it says “You need a page before you can embed one”, publish the page first.

Program sign-up forms

A program’s registration form can go on your website, on paper, or in a message. Open the program, go to Registration form, and find the card The link families use. Everyone who manages the program’s sign-up form sees the share tools there, a program coordinator included. The form must be published first; a draft has no link.

  • Copy link copies the form’s web address. Send it by email or text, or link to it from your site.
  • QR code shows a code that opens the same form. Print it on a flyer or put it on a screen at the front desk.
  • Embed on your website opens Put the sign-up form on your website with two snippets:
    • On the page puts the form inside your page. Families fill it in without leaving your site.
    • As a button adds a Sign up button. The form opens in a popup over your page.

Paste either snippet into your site’s HTML, then use Copy embed code to copy it. Sign-ups land on the program in Muin, the same as sign-ups from the link.

Allowed sites

You choose which websites may show your pages in a frame under Settings → Public Calendar → Embed widget → Allowed origins. The same list covers the events calendar, single event pages and sign-up forms.

  • An empty list means any website can embed your pages. This is the default.
  • Once you add a site, only listed sites can embed them. Any other site sees “This page can’t be shown on this website.” with a link that opens the page in a new tab.

Each entry is a full https:// address, such as https://www.example.org. Muin keeps only the site part, so https://www.example.org/programs is saved as https://www.example.org. Save your settings after adding a site. The links and QR codes still work everywhere, because they open the page on Muin rather than inside another site.

What you can embed

Surface Path shape
Smart forms /go/<tenant>/form/<slug>
Donation pages /go/<tenant>/donate/<slug>
Giving page shortcut /go/<tenant>/give
Event pages /go/<tenant>/event/<id>
Membership page /go/<tenant>/membership
Grant applications /go/<tenant>/grants/apply/<slug>
Support portal /go/<tenant>/support
Payment links /go/<tenant>/pay/<token>
Kiosk /go/<tenant>/kiosk/<slug> and /go/<tenant>/kiosk/donate
Public events calendar /go/<tenant>/calendar and /go/<tenant>/calendar/embed
Bulletin board /embed/bulletin/<tenant>
Impact block /embed/impact/<tenant>

Widget shapes

The embed panel offers each page in several shapes, and the same page can be embedded more than once on a site in different shapes: a plain link, a button, an inline form, a popup, a floating action button, a banner, a campaign thermometer, a zakat calculator, the support widget and the bulletin board.

Every inline shape (a form, a giving or event page, the full campaign page, the campaign thermometer, the bulletin board and the events calendar) uses the embed/loader.js snippet:

<script src="https://muin.falaah.ai/embed/loader.js" async></script>
<div data-muin-embed="https://muin.falaah.ai/go/your-tenant/donate/your-page"></div>

The frame starts at a sensible height and then grows or shrinks to fit the page as the visitor moves through it.

The thermometer is only offered when the page has a campaign set, because it shows that campaign’s progress.

The button, popup, floating and banner shapes load through a small script tag:

<script
  src="https://muin.falaah.ai/embed/widget.js"
  data-tenant="your-tenant"
  data-type="giving"
></script>

The bulletin board renders as a grid, in 1x1 (the default), 1x2, 1x3 or 2x3.

Inline forms, giving pages and popups are as wide as the page’s own width setting, so a wider page makes a wider embed.

To fix an embed at a set width, pick it under Embed width where you copy the code. “Match the page” (the default) follows the page’s width; the other choices are the page widths, from Narrow (480px) to Full page (1200px). The copied snippet then carries a data-width attribute.

If you write a snippet by hand, add data-width yourself, for example data-width="640" (pixels) or data-width="100%".

Any other path (admin routes, authenticated dashboards, /api/*) is deliberately blocked from iframe embedding: the response middleware sets X-Frame-Options: DENY and Content-Security-Policy: frame-ancestors 'none' on those.

Without scripts: a plain iframe

Use this only if your site builder strips script tags. A plain iframe cannot grow to fit the page, so give it a fixed height that fits the tallest state:

<iframe
  src="https://muin.falaah.ai/go/your-tenant/donate/sustainer?embedded=true"
  width="100%"
  height="700"
  frameborder="0"
  style="border: none; border-radius: 8px;"
  title="Donate"
></iframe>

The iframe loads cross-origin from muin.falaah.ai and renders the form. Submissions hit Muin directly: your host page doesn’t proxy anything.

Embed shapes

The same /go/* URL works in any of these placements. Live demos at /live/embed-shapes:

  1. Inline: drops into normal page flow and grows to fit the page.
  2. Side widget: sticky sidebar iframe, scroll-pinned.
  3. Modal: click a button, <dialog> opens with the iframe inside.
  4. Scroll-popup: iframe surfaces after the visitor scrolls past 50%.
  5. Exit-intent: iframe surfaces when the cursor leaves the top edge.
  6. Floating action button: a bottom-right circular button reveals a slide-up panel.
  7. Banner: a top strip with an embedded mini-form, dismissible for 7 days.

You can mix and match: a single page can have a banner, an inline embed, and a FAB simultaneously.

What gets passed through

  • ?embedded=true: appended by embedUrl() as a marker query param. Drives no chrome changes today; it’s a forward-looking hook your host page can also key off (analytics, A/B tests).
  • Other query strings on the URL: preserved end-to-end. Use them to pre-fill fields supported by HiddenField.
  • Iframe-to-parent messages, when a form submits successfully, Muin posts a muin:form-submitted MessageEvent to window.parent so your host page can react (close the modal, fire confetti, redirect). See transitions.

What does NOT work in an embed

Behavior Why
Browser auth / login flows Embedded forms run anonymously; no auth needed
Cookies (third-party blocked) Forms don’t rely on cookies; tokens go in body
Top-level navigation from iframe Sandboxed by browsers; trigger via postMessage
Forms behind tenant authorization Use the standalone URL, not embed

Building URLs programmatically

If you’re embedding from another Muin tool (a marketing site, a microsite), use the helpers instead of hardcoding the origin:

import { embedUrl, embedSnippet } from "@/lib/embed";

const url = embedUrl("/go/your-tenant/donate/sustainer");
// → "https://muin.falaah.ai/go/your-tenant/donate/sustainer?embedded=true"

const html = embedSnippet("/go/your-tenant/form/volunteer", {
  height: 800,
  title: "Volunteer signup",
});
// → "<iframe src='...' width='100%' height='800' ... title='Volunteer signup'></iframe>"

The helpers read PUBLIC_APP_URL from env so your dev / staging / prod URLs stay consistent without code changes.

Live examples

When it goes wrong

What you see What to do
“You need a page before you can embed one” Create and publish the page, then come back to Embed & Share.
“Pick a page above and your code will appear here.” The panel refuses to guess which page you mean. Choose one.
The iframe loads but shows “not found” The page is a draft or paused. Only published pages resolve publicly.
The embed is blank on your site Check that the path is under /go/* or /embed/*. Any other path is blocked from framing on purpose.
A payment embed will not take a card The page’s form collects payments and no charge-ready Stripe account is connected. Connect payments and republish.
“This page can’t be shown on this website.” Your organization has a list of allowed sites and this site is not on it. Add it under Settings → Public Calendar → Embed widget, or empty the list to allow any site.
The snippet works on one page of your site and not another A content-security policy on your own site can block the iframe or the script. Check your site’s CSP for frame-src and script-src.

Next