Wix integration
Add the Donations Embed to any Wix page using the Embed HTML element.
Wix integration
This guide adds the Donations Embed to any Wix page using the Embed HTML element. It works with the Wix Editor (the drag-and-drop classic), the Wix Studio editor (the newer Editor X-style), and Velo-by-Wix sites.
Note: Wix's free plan does not allow custom HTML embeds. Confirm you are on a paid plan (Combo, Unlimited, Pro, VIP, or Business) before starting.
Step 1: Generate a sandbox publishable key
In the 1st Flock Hub:
- Open Donations Embed → Keys.
- Click Create key pair.
- Set environment to Sandbox and name it (e.g.
My Wix site - sandbox). - Copy the publishable key (starts with
pk_test_).
Step 2: Add an Embed HTML element
- Open your Wix Editor and navigate to the page where you want the embed.
- Click Add elements (the + button on the left toolbar).
- Find Embed Code in the menu, then choose Embed HTML (also labelled Custom Embeds → Embed HTML).
- The element drops onto your canvas with an "Add Your Code" placeholder.
- Click Enter Code.
- Paste the snippet below into the editor. Replace
pk_test_REPLACE_MEwith your publishable key.
<flock-donate
publishable-key="pk_test_REPLACE_ME"
mode="inline"
></flock-donate>
<script type="module" src="https://sandbox.payments.1stflock.com/v1.js"></script>
- Click Update.
- Resize the Embed HTML element on the canvas to roughly 500 px wide × 720 px tall — Wix renders the embed inside a fixed-size iframe, so the container needs enough room for the donor flow. The embed itself is responsive; the constraint is just the Wix iframe.
- Click Publish (top right).
Step 3: Test the donation flow (sandbox)
- Open the published site URL in a new browser tab.
- Walk through the donor flow.
- At the payment step, use these sandbox card details:
See Getting Started → Sandbox testing for the canonical sandbox card details (4111 1111 1111 1111, exp 10/29, CVV 123).
- Submit. You should see a confirmation screen with an ID like
don_8a1b9c4d. - Open the Hub's Donations tab — your test donation appears within a few seconds, marked with a TEST badge.
Step 4: Switch to live
When you are ready to take real donations:
- Generate a live key pair in the Hub (environment set to Live).
- Edit the page in Wix.
- Open the Embed HTML element and replace the
pk_test_…value with the newpk_live_…value. - In the same snippet, change the script
srcfromhttps://sandbox.payments.1stflock.com/v1.jstohttps://payments.1stflock.com/v1.js. - Publish.
The publishable key and the script host must change together — they are paired.
Cross-mismatch enforcement. If you load the SDK from
payments.1stflock.combut supply apk_test_*key, the SDK throws with:Live SDK cannot use test keys. Load https://sandbox.payments.1stflock.com/v1.js instead.Same in reverse forsandbox.payments.1stflock.com+pk_live_*.
Customisation
Modal launcher button
For a non-disruptive call-to-action that opens the flow in a modal:
<flock-donate
publishable-key="pk_test_REPLACE_ME"
mode="modal"
trigger-label="Give"
></flock-donate>
<script type="module" src="https://sandbox.payments.1stflock.com/v1.js"></script>
In modal mode, you can shrink the Embed HTML element on the Wix canvas down to roughly 200 px × 80 px — only the launcher button needs space; the modal opens at viewport scale.
Constrain to a specific fund
<flock-donate
publishable-key="pk_test_REPLACE_ME"
funds="general"
default-fund="general"
></flock-donate>
<script type="module" src="https://sandbox.payments.1stflock.com/v1.js"></script>
The fund picker is hidden when only one fund is available.
The full attribute reference is in Browser Embed.
Common pitfalls
Note: The Embed HTML element is missing from the menu. Your Wix plan does not include custom embeds. Upgrade to a paid plan.
Note: The embed renders inside a tiny scrollable iframe. The Embed HTML element renders in a fixed-size iframe whose dimensions you set on the Wix canvas. Resize the element on the canvas to match the embed's natural size (about 500 × 720 px for inline mode, or 200 × 80 px for modal mode where only the launcher button shows).
Note: Modal mode opens the donor flow inside the Wix iframe instead of over the whole page. This is a Wix iframe sandbox limitation — the modal cannot escape the iframe boundary. To get a true full-page modal in Wix, use
mode="inline"and let the donor scroll, or contact Wix support to lift the iframe sandbox restrictions for your site (some plans allow this).
Note: The donation appears in the Hub but the success screen is cut off. The Embed HTML element's iframe is too short. Increase the height on the Wix canvas to roughly 720 px so the success screen fits.
Note: My Velo-by-Wix code keeps competing with the embed. The embed is a self-contained web component; do not call any Velo functions against it (
$w()selectors do not see inside Shadow DOM). Treat the embed as a black box that emits its own events.
Next steps
- Try other render modes — see Browser Embed → Render modes.
- Receive donation events on your server — see Webhooks.
- Check the Compliance & Security page for the CSP recipe and customer obligations.