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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@collectapp/checkout-sdk

v1.1.4

Published

Collect Africa Checkout library

Readme

Collect Widget - JavaScript SDK

JS library for implementing the Collect widget - CollectWidgetJS is a safe and secure web drop-in module and this library provides a front-end web with ability to make payment for each bank that Collect [supports].

Try the demo

Checkout the widget flow to view how the Collect Widget works. Click "See How it Works"

Before getting started

  • Retrieve your Client Public API Keys.
  • Create a sandbox customer, so you can get connecting immediately.

Installing

Using npm:

$ npm install @collectapp/checkout-sdk

Using yarn:

$ yarn add @collectapp/checkout-sdk

Using CDN:

<script src="https://cdn.collect.africa/collect-africa.js"></script>

Usage

For JS frameworks import it and use

import CollectCheckoutService from '@collectapp/checkout-sdk';

For others, just use

const checkout = new CollectCheckoutService({
  email: '[email protected]',
  firstName: 'Peter',
  lastName: 'Parker',
  reference: 'XXXXX-XXXXX',
  amount: 1000000, // in Kobo
  currency: 'NGN', // NGN
  itemImage: '', // URL for item image
  paymentLinkCode: '', // Payment link code
  invoiceCode: '', // Invoice code
  planCode: '', // Plan code
  publicKey: 'pk_sandbox_XXXXXXXXXX', // Your public key
  onSuccess(e) {
    console.log('payment successful.', e);
  },
  onClose(e) {
    console.log('closed the widget.', e);
  },
});

checkout.setup();
checkout.open();

CollectWidget Options

| Name | Type | Required | Default Value | Description | | ----------------- | ------------- | -------- | -------------- | -------------------------------------------- | | email | String | true | | Email address. | | firstName | String | true | | First name. | | lastName | String | false | | Last name. | | reference | String | true | | Unique transaction reference | | amount | Number | true | | Amount to charge. | | currency | String | false | NGN | Processing currency | | itemImage | String(URL) | false | | URL for item image | | publicKey | String | true | | The Collect public api key. | | paymentLinkCode | String | false | | The payment link code. | | invoiceCode | String | false | | The invoice code. | | planCode | String | false | | The plan code. | | logo | String(URL) | false | Collect's Logo | | | callbackUrl | String(URL) | false | | | | onSuccess | Function | false | | Action to perform after widget is successful | | onClose | Function | false | | Action to perform if widget is closed | | onError | Function | false | | Action to perform on widget Error | | beforeClose | Function | false | | Action to perform before widget close |

Other information

For enquires and questions, contact