npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@felloh-org/payment-sdk

v1.0.23

Published

[![Version](https://img.shields.io/npm/v/@felloh-org/payment-sdk.svg)](https://www.npmjs.com/package/@felloh-org/payment-sdk) [![Build Status](https://github.com/felloh-org/payment-sdk/actions/workflows/release.yml/badge.svg?branch=main)](https://github.c

Readme

Felloh Payment SDK

Version Build Status Downloads

The official browser-side SDK for embedding Felloh payment forms into your website. Felloh is a payment platform that enables businesses to accept card payments and open banking transactions.

This SDK renders a secure, hosted payment form inside an iframe and communicates payment lifecycle events back to your application via callbacks.

Installation

Package Manager

npm install @felloh-org/payment-sdk

or with Yarn:

yarn add @felloh-org/payment-sdk

CDN

Alternatively, include the SDK directly via script tag:

<script src="https://sdk.felloh.com/"></script>

When loaded via CDN, the SDK is available globally as FellohPayments.

Prerequisites

Before rendering a payment form, you need to create an ecommerce instance server-side using the Felloh API. This returns an ecommerce ID that you pass to the SDK on the frontend.

  1. Authenticate — obtain a bearer token by posting your public and private keys to https://api.felloh.com/token
  2. Create a booking (optional) — bookings enable payout assignments and require fields like organisation, customer_name, email, booking_reference, departure_date, return_date, and gross_amount
  3. Create an ecommerce instance — provide organisation, customer_name, email, amount, and payment method flags (open_banking_enabled, card_enabled). The returned ID is what you pass to render()

See the embedding a payment guide for full details.

Quick Start

<div id="payment-iframe" style="min-width: 350px;"></div>
import SDK from '@felloh-org/payment-sdk';

const felloh = new SDK('payment-iframe', 'YOUR_PUBLIC_KEY');

felloh.onRender(() => {
  console.log('Payment form is ready');
});

felloh.onSuccess((data) => {
  console.log('Payment successful', data.transaction.id);
});

felloh.onDecline((data) => {
  console.log('Payment declined', data.transaction.id);
});

felloh.render('ecommerce-instance-uuid');

Replace YOUR_PUBLIC_KEY with your publishable API key from the Felloh Dashboard.

Constructor

new FellohPayments(containerID, publicKey, options?)

| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | containerID | string | Yes | The ID of the DOM element where the payment form will render. Must be at least 350px wide. | | publicKey | string | Yes | Your publishable API key from the Felloh Dashboard. | | options | object | No | Configuration options (see below). |

Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | sandbox | boolean | false | Use the sandbox environment for testing. | | moto | boolean | false | Enable Mail Order / Telephone Order mode. | | design.pay_button | boolean | true | Show the built-in pay button. Set to false to trigger payment manually with pay(). | | design.store_card | boolean | true | Show the option for customers to store their card. |

const felloh = new SDK('payment-iframe', 'YOUR_PUBLIC_KEY', {
  sandbox: true,
  moto: false,
  design: {
    pay_button: false,
    store_card: true,
  },
});

Methods

render(ecommerceID)

Renders the payment form for the given ecommerce instance ID. The ID must be a valid UUID obtained from the Felloh API.

felloh.render('a1b2c3d4-e5f6-7890-abcd-ef1234567890');

Returns the SDK instance for chaining.

pay()

Manually triggers payment processing. Use this when design.pay_button is set to false so you can run your own validation before initiating payment.

document.getElementById('my-pay-button').addEventListener('click', () => {
  if (validateForm()) {
    felloh.pay();
  }
});

getStatus()

Returns the current status of the payment form. Possible values:

| Status | Description | |--------|-------------| | preload | Initial state, before the form has loaded. | | rendered | The payment form is loaded and ready. | | processing | Payment is being processed. | | success | Payment completed successfully. | | declined | Payment was declined. |

Events

All event callbacks can be registered before or after calling render().

onRender(callback)

Fires when the payment form has finished loading inside the iframe.

felloh.onRender(() => {
  document.getElementById('loading-spinner').style.display = 'none';
});

onSuccess(callback)

Fires when the payment is completed successfully. The callback receives a data object containing the transaction ID.

felloh.onSuccess((data) => {
  console.log('Transaction ID:', data.transaction.id);
  window.location.href = '/payment/confirmation';
});

onDecline(callback)

Fires when the payment is declined. The callback receives a data object containing the transaction ID.

felloh.onDecline((data) => {
  console.log('Declined transaction:', data.transaction.id);
});

onProcessing(callback)

Fires when the payment has been submitted and is being processed. The callback receives a data object containing the transaction ID.

felloh.onProcessing((data) => {
  console.log('Processing transaction:', data.transaction.id);
});

Environments

| Environment | Usage | |-------------|-------| | Production | Default. Live payments. | | Sandbox | Set sandbox: true. For testing and development. |

Use the sandbox environment during development with test credentials from the Felloh Dashboard. Switch to production by removing the sandbox option or setting it to false.

Full Example

<!DOCTYPE html>
<html>
<head>
  <title>Checkout</title>
  <script src="https://sdk.felloh.com/"></script>
</head>
<body>
  <div id="payment-iframe" style="min-width: 350px;"></div>
  <button id="pay-btn" style="display: none;">Pay Now</button>

  <script>
    var felloh = new FellohPayments('payment-iframe', 'YOUR_PUBLIC_KEY', {
      sandbox: true,
      design: { pay_button: false },
    });

    felloh.onRender(function () {
      document.getElementById('pay-btn').style.display = 'block';
    });

    felloh.onSuccess(function (data) {
      alert('Payment successful! Transaction: ' + data.transaction.id);
    });

    felloh.onDecline(function (data) {
      alert('Payment declined. Please try again.');
    });

    felloh.onProcessing(function (data) {
      document.getElementById('pay-btn').disabled = true;
      document.getElementById('pay-btn').textContent = 'Processing...';
    });

    document.getElementById('pay-btn').addEventListener('click', function () {
      felloh.pay();
    });

    // Replace with your ecommerce instance ID from the Felloh API
    felloh.render('your-ecommerce-uuid');
  </script>
</body>
</html>

Demo

See a working example of the embedded payment form at https://embedded-demo.sandbox.felloh.com/.

Documentation

License

MIT