Script tag

Start using Everfund's donation elements with a Script Tag.

When developing a website without using a JavaScript bundler like Vite or Webpack, you will want to use hosted libraries on a CDN network like JSDelivr.

The best way to implement Everfund into a website that does not have a bundling stage is using the JSDelivr CDN. The script below is recommended to be added just before the end of </body>

Install Donation Elements

<script>
  {
    !(function (w, d, i, s) {
      function l() {
        if (!d.getElementById(i)) {
          var f = d.getElementsByTagName(s)[0],
            e = d.createElement(s);
          (e.type = "text/javascript"),
            (e.async = !0),
            (e.src = "https://cdn.jsdelivr.net/npm/@everfund/js-sdk@1.3.3/dist/js-sdk.umd.js"),
            f.parentNode.insertBefore(e, f);
        }
      }
      if ("function" != typeof w.Everfund) {
        var c = function () {
          c.q.push(arguments);
        };
        (c.q = []),
          (w.Everfund = c),
          "complete" === d.readyState
            ? l()
            : w.attachEvent
              ? w.attachEvent("onload", l)
              : w.addEventListener("load", l, !1);
      }
    })(window, document, "everfund", "script")
  }
</script>
  1. Download the domain association file found here.
  2. Upload the verification file to your website so it is accessible at charityname.com/.well-known/apple-developer-merchantid-domain-association
  3. Navigate to the domain page found in your Organization’s settings page in the Everfund dashboard.
  4. Enter your domain name in the new domain form. These are the domains that you want to enable browser payments on, and they must be the same as the domain that you are hosting your donation portal on.
  5. Click on the verify button in the Everfund dashboard

Attach the data-ef-modal attribute to the element you want to trigger the modal

<button data-ef-modal="https://evr.fund/j1q16MvJl5lqfji06bVFKei3HZkW">Donate Now</button>
Edit this page