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

zru-js

v1.0.1

Published

JS library for the ZRU API.

Readme

ZRU JS

Overview

The ZRU JS SDK provides seamless integration with the ZRU API, enabling developers to easily manage the payment options in their applications.

Installation

You can install using npm:

npm install zru-js

or to install from source, download zru.min.js and include it in your HTML document, this will add a global object called ZRU:

<script src="zru.min.js"></script>

Quick Start Example

Initialize the SDK

var zru = new ZRU(
  'PUBLIC KEY', // Public key
  { // Optional
    iframeId: 'zru-iframe', // Default is 'zru-iframe'. ID of the iframe where the payment page will load, required if you choose the iframe option for apmOpenType or have a card payment option
    htmlDivId: 'zru-html-div', // Default is 'zru-html-div'. ID of the div where the payment form will load if you choose the html option for apmOpenType

    // apmOpenType: Specifies how the payment page will open. 
    // Possible values:
    // 'redirect': Redirects the user to the payment page of the gateway.
    // 'html': Include the payment form directly on this page and submit it to redirects the user to the payment page of the gateway without pass for our payment page.
    // 'iframe': Loads the payment page inside the iframe (some payment gateways may not support this), keeping the user on this page.
    // 'window': Opens a window with the payment page, keeping the user on this page.
    apmOpenType: 'redirect', // Default is 'redirect'. Change it depending on how you want the user to interact with the payment page.

    // apmSettings: Allows you to configure different settings for each payment gateway.
    // This object can include settings such as apmOpenType for specific gateways. 
    // Example: { 'PPI': 'html' } to use the 'html' option for the PayPal gateway.
    apmSettings: {},

    // windowsClosedCallback: A callback function that triggers when the payment window is closed if using 'window' as apmOpenType.
    // This can be useful for handling cases where the user closes the window without completing the payment.
    windowsClosedCallback: undefined,
    
    // windowsCompletedCallback: A callback that is triggered when the payment is successfully completed using the 'window' option.
    // Useful to perform actions such as redirecting the user or displaying a confirmation message.
    windowsCompletedCallback: undefined,
  }
);

Set the token to use

// Set the transaction, subscription, or authorization token to be used in this payment session.
zru.setToken('TOKEN');

Get the gateway to show

// Get the available gateways for the current token
var gateways = zru.getGateways();
// Example creating one button for each gateway
gateways.forEach(function (gateway) {
    // Create a button dynamically for each gateway returned by the getGateways function
    var button = document.createElement('button');
    button.innerHTML = "<img width=35px height=35px src=" + gateway.image + ">" + gateway.name;
    document.getElementById('gateways').appendChild(button);

    // When the button is clicked, select the corresponding gateway for the payment
    button.onclick = function () {
        zru.selectGateway(gateway.code);
    };
});

More information

You can see examples of Google Pay and Apple Pay in the test.html file inside the test folder.