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

@fluidcoins/pay.js

v0.1.15

Published

Fluidcoins Pay Javascript SDK

Readme

Documentation

Fluidcoins Pay.js

Fluidcoins Pay.js is quick and secure way to receive crypto payments in your application. It works with all Javascript frameworks

Requirement

Nodejs version > 10

Getting Started

1: Register a merchant account on Fluidcoins and get your public API key

Installation

You can install the package via NPM or Yarn;

npm install @fluidcoins/pay.js

OR

yarn add @fluidcoins/pay.js

Usage

Parameters

  • key
  • amount
  • email
  • onSuccess
  • onLoad (optional)
  • onClose (optional)
  • onError (optional)
  • name (optional)
  • phone (optional)
  • metadata (optional)
  • callback_url (optional)
  • currency (optional)
  • reference (optional)

key

REQUIRED

This is your Fluidcoins public API key from the Fluidcoins dashboard.

new Fluidcoins({key: 'fluidcoins_public_api_key'})

amount

REQUIRED

This is amount in the smallest unit of currency you'd want to receive from the customer.

NOTE: The minimum amounts are

  • 500 NGN for the Nigerian Naira
  • 1 USD for the United State Dollars
new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 50000 // or 100 for 1 USD
})

email

REQUIRED

This is the email address of the customer

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]'
})

onSuccess

REQUIRED

This is function that will be called when a successful transaction occurs.

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})}
})

A JSON payload is passed as argument with the structure below;

{ 
    reference: TRANS_REFERENCE,
    coin: 'BTC',
    human_readable_amount: 1000,
    payment_status: 'underpaid | overpaid | paid_in_full'
}

Payment status could be overpaid, underpaid or paid_in_full

onLoad

OPTIONAL

This closure is called once the Fluidcoins PaySDK loads

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
    onLoad: () => { console.log('Loaded sdk successfully')}
})

onClose

OPTIONAL

This optional closure is called when a user closes the Fluidcoins Widget. It takes no argument

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')}
})

onError

OPTIONAL

This optional closure is called when an error occurs. Error such as session expired, etc.

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
})

A JSON payload is passed as argument with the structure below;

{ 
    type: 'expired',
}

Error type could be;

  • expired : Payment session for the initiated transaction expired

name

OPTIONAL

This optional parameter; which is the name of customer who want to initiate the transaction. It reflects on the Fluidcoins dashboard.

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
    name: 'Seun Akanni'
})

phone

OPTIONAL

This optional parameter; which is the phone number of customer who want to initiate the transaction. It reflects on the Fluidcoins dashboard.

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
    name: 'Seun Akanni',
    phone: '+2348090909090',
})

reference

OPTIONAL

This optional parameter; which is used to identify the initiated transaction.

NOTE : It must be unique per transaction

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
    name: 'Seun Akanni',
    phone: '+2348090909090',
    reference: 'random-identifier'
})

metadata

OPTIONAL

This optional parameter, which is should contain data you will like to be passed via webhooks about the transaction. NOTE: The metadata must be an OBJECT

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
    name: 'Seun Akanni',
    phone: '+2348090909090',
    metadata: {
        key: 1
    }
})

callback_url

OPTIONAL

This optional parameter is used to open a new window tab when a successful [ underpaid, overpaid, paid_in_full ] payment occurs. NOTE: The callback_url must be a valid URL with a HTTPS scheme . Also, it DOES NOT override the onSuccess() event.

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
    name: 'Seun Akanni',
    phone: '+2348090909090',
    metadata: {
        key: 1
    },
    callback_url: 'https://www.google.com/'
})

currency

OPTIONAL

Possible values are the ISO 4217 currency codes, such as "USD" for the US dollar"

NOTE: It defaults to default currency set on your Fluidcoins dashboard.

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
    name: 'Seun Akanni',
    phone: '+2348090909090',
    metadata: {
        key: 1
    },
    callback_url: 'https://www.google.com/',
    currency: 'USD'
})

reference

OPTIONAL

This optional parameter is used as a reference instead of the Fluidcoins auto-generated reference. We recommended random string.

new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onLoad: () => { console.log('Loaded sdk successfully')},
    onClose: () => { console.log('User closed widget')},
    onError: (error) => { console.log({error})},
    name: 'Seun Akanni',
    phone: '+2348090909090',
    metadata: {
        key: 1
    },
    callback_url: 'https://www.google.com/',
    currency: 'USD',
    reference: 'REF_random_reference'
})

API References

setup()

This method is used to load the widget unto the DOM, the widget remains hidden after invoking this function until the open() method is called.

const fluidcoins = new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
})
fluidcoins.setup()

open()

This method makes the widget visible to the user.

const fluidcoins = new Fluidcoins({
    key: 'fluidcoins_public_api_key',
    amount: 100000,
    email: '[email protected]',
    onSuccess: (data) => { console.log({data})},
})
fluidcoins.setup()
fluidcoins.open()

More on Documentations

Fluidcoins Developer's section