Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@everfund/js-sdk

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@everfund/js-sdk

Plug and Play Donation System

  • 3.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
decreased by-40%
Maintainers
0
Weekly downloads
 
Created
Source

logo

Everfund Docs Github Action Test Status GitHub commit activity Follow on X

@everfund/js-sdk

Changelog · Report a Bug · Request a Feature · Ask a Question


Overview

Our core JavaScript library for building modern donation experiences. It provides components like checkout forms, subscription management, and donor profiles to help developers quickly integrate donation functionality into nonprofit websites and applications.

Getting Started

Installation

There are two ways you can include @everfund/js-sdk in your project. You can either import the @everfund/js-sdk npm module or load @everfund/js-sdk with a script tag.

Install everfund/js-sdk as ES module

pnpm i @everfund/js-sdk
# or
yarn add @everfund/js-sdk
# or
npm install @everfund/js-sdk
import everfund from '@everfund/js-sdk';

document?.getElementById('donate-modal')?.addEventListener('click', () => {
  console.log('launch Everfund Modal');
  everfund.donationWidget({
    code: '078f',
    onSuccess: function (onSuccessPayload) {
      console.log(onSuccessPayload);
    },
    onFailure: function (error) {
      console.log(error);
    },
    onClose: function () {
      //
      console.log('Closed Modal');
    },
  });
});

Install @everfund/js-sdk as script

Add the following script to your site's <body> element:

<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/dist/js-sdk.global.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>

Usage

<body>
  <div class="buttonContainer">
    <button data-ef-modal="j1q16MvJl5lqfji06bVFKei3HZkW">Donate Now</button>
  </div>
</body>

For further details and examples, please refer to our Documentation.

Build

To build the package locally with tsup, run:

pnpm build

Contributing

At Everfund, we strive to create an inclusive and welcoming environment for all contributors.

To ensure a productive and respectful experience for everyone involved, we have established a few ground rules.

Please review our Code of Conduct before getting started.

If you're new to the project, you may want to start with one of our designated "good first issues" These issues are specifically chosen to be accessible and easy to understand, making them a great introduction to the project.

Together, let's build something amazing!

Security

@everfund/js-sdk follows good practices of security, but 100% security cannot be assured.

@everfund/js-sdk is provided "as is" without any warranty. Use at your own risk.

For more information and to report security issues, please refer to our security documentation.

License

This project is licensed under the MIT license.

See LICENSE for more information.

FAQs

Package last updated on 23 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc