Catalog npm
Back to packageRELEASE DETAILS

1.0.7

npm

54pay-payments-sdk

A Javascript-based SDK for integrating payment methods via 54Pay.

Published3 Aug 2026
Direct dependencies56
Transitive dependenciesNot calculated

README

Current package documentation

54pay-payment-sdk

A JavaScript/TypeScript SDK for accepting payments via 54Pay. This release covers the Nigeria (NGN) checkout: Bank Transfer, OPay, PalmPay and Kuda.

Installation

npm install 54pay-payment-sdk
# or
yarn add 54pay-payment-sdk

react, react-dom and styled-components are peer dependencies — install them in your app if you haven't already:

npm install react react-dom styled-components

Usage

The SDK mounts the checkout into a DOM element you provide via its id.

ES module / bundler (React, Vite, Next.js, etc.)

import { FiftyFourPayPaymentSdk } from "54pay-payment-sdk";

FiftyFourPayPaymentSdk.setup({
  targetId: "checkout-container", // id of an element already in the DOM
  props: {
    userData: {
      amount: 1000,
      transactionRef: "ORDER_12345",
      merchantPublicKey: "PK-…",
      countryCode: "NGA",
      currencyCode: "NGN",
      transactionCurrency: "NGN",
      firstName: "Ada",
      lastName: "Obi",
      email: "ada@example.com",
      phoneNumber: "8160009000",
    },
    config: { environment: "live", theme: "light" },
    onSuccess: (transactionId) => console.log("paid", transactionId),
    onError: (error) => console.error("payment failed", error),
  },
});
<div id="checkout-container"></div>

Script tag (CDN / global)

<script src="https://cdn.jsdelivr.net/npm/54pay-payment-sdk/dist/index.iife.js"></script>
<div id="checkout-container"></div>
<script>
  window["54PaySdk"].setup({
    targetId: "checkout-container",
    props: {
      userData: {
        amount: 1000,
        transactionRef: "ORDER_12345",
        merchantPublicKey: "PK-…",
        countryCode: "NGA",
        currencyCode: "NGN",
        firstName: "Ada",
        lastName: "Obi",
        email: "ada@example.com",
        phoneNumber: "8160009000",
      },
      config: { environment: "live" },
      onSuccess: (transactionId) => console.log("paid", transactionId),
    },
  });
</script>

API

FiftyFourPayPaymentSdk.setup({ targetId, props })

FieldTypeDescription
targetIdstringid of the DOM element to render the checkout into.
propsPaygateCheckoutSdkPropsCheckout configuration (see below).

props

FieldTypeRequiredDescription
userDataMerchantDataPropsyesTransaction + customer details (see below).
config{ environment?,}noenvironment: "test" | "live" (default test), theme: "light" | "dark".
onSuccess(transactionId?: string) => voidnoCalled once when the payment completes.
onError(error?: unknown) => voidnoCalled once when the payment fails.

userData (MerchantDataProps)

Required

FieldTypeNotes
amountnumberMust be a positive number.
transactionRefstringYour unique reference. Used as the recovery key.
merchantPublicKeystringYour 54Pay public key, used for API auth.
country / currencystringProvide at least one of countryCode (e.g. "NGA"), currencyCode (e.g. "NGN") or transactionCurrency so the SDK can resolve the country profile.
firstName, lastName, email, phoneNumberstringCustomer details.

Common optional fields: merchantName, merchantReference, transactionDescription, redirectUrl, successUrl, errorUrl, cancelUrl, webhookUrl, customerAddress, customerCity, customerState, metadataOrderId, metadataProductInfo. See the exported MerchantDataProps type for the full list.

Environments

config.environment selects the backend:

  • "test" → 54Pay test environment
  • "live" → 54Pay production environment

If omitted, the SDK defaults to the test environment.

Supported regions

The region is resolved from userData.countryCode and/or userData.currencyCode / transactionCurrency.

RegionCountry codeCurrencyPayment methods
NigeriaNGANGNBank Transfer (dynamic virtual account), OPay, PalmPay, Kuda
GhanaGHAGHSMobile Money
CameroonCMRXAFMobile Money
KenyaKENKESMobile Money
GambiaGMBGMDMobile Money

Because XAF is shared across the six-country CFA zone, Cameroon is resolved from countryCode — send "CMR" (or "CM") to get the Cameroon profile.

If you pass an unsupported country/currency, the checkout will not mount — instead onError is called with:

{ code: "UNSUPPORTED_REGION", message: "…" }

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 59

Native requirements
56 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
axios
Environment
{
  "local_name": "axios",
  "alias": false,
  "peer_metadata": null
}
^1.13.5runtime
moment
Environment
{
  "local_name": "moment",
  "alias": false,
  "peer_metadata": null
}
^2.30.1runtime
fontawesome
Environment
{
  "local_name": "fontawesome",
  "alias": false,
  "peer_metadata": null
}
^5.6.3runtime
react-icons
Environment
{
  "local_name": "react-icons",
  "alias": false,
  "peer_metadata": null
}
^5.5.0runtime
styled-system
Environment
{
  "local_name": "styled-system",
  "alias": false,
  "peer_metadata": null
}
^5.1.5runtime
card-validator
Environment
{
  "local_name": "card-validator",
  "alias": false,
  "peer_metadata": null
}
^10.0.3runtime
credit-card-type
Environment
{
  "local_name": "credit-card-type",
  "alias": false,
  "peer_metadata": null
}
^10.1.0runtime
react-router-dom
Environment
{
  "local_name": "react-router-dom",
  "alias": false,
  "peer_metadata": null
}
^7.5.3runtime
libphonenumber-js
Environment
{
  "local_name": "libphonenumber-js",
  "alias": false,
  "peer_metadata": null
}
^1.12.24runtime
@radix-ui/react-toast
Environment
{
  "local_name": "@radix-ui/react-toast",
  "alias": false,
  "peer_metadata": null
}
^1.2.15runtime
@fortawesome/fontawesome-free
Environment
{
  "local_name": "@fortawesome/fontawesome-free",
  "alias": false,
  "peer_metadata": null
}
^7.2.0runtime
@fortawesome/react-fontawesome
Environment
{
  "local_name": "@fortawesome/react-fontawesome",
  "alias": false,
  "peer_metadata": null
}
^3.2.0runtime
@fortawesome/fontawesome-svg-core
Environment
{
  "local_name": "@fortawesome/fontawesome-svg-core",
  "alias": false,
  "peer_metadata": null
}
^7.2.0runtime
@fortawesome/free-solid-svg-icons
Environment
{
  "local_name": "@fortawesome/free-solid-svg-icons",
  "alias": false,
  "peer_metadata": null
}
^7.2.0runtime
@fortawesome/free-brands-svg-icons
Environment
{
  "local_name": "@fortawesome/free-brands-svg-icons",
  "alias": false,
  "peer_metadata": null
}
^7.2.0runtime
@fortawesome/free-regular-svg-icons
Environment
{
  "local_name": "@fortawesome/free-regular-svg-icons",
  "alias": false,
  "peer_metadata": null
}
^7.2.0runtime
vite
Environment
{
  "local_name": "vite",
  "alias": false,
  "peer_metadata": null
}
^6.3.3development
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^19.2.4development
rollup
Environment
{
  "local_name": "rollup",
  "alias": false,
  "peer_metadata": null
}
^4.59.0development
recharts
Environment
{
  "local_name": "recharts",
  "alias": false,
  "peer_metadata": null
}
^2.15.3development
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^19.2.4development
typescript
Environment
{
  "local_name": "typescript",
  "alias": false,
  "peer_metadata": null
}
^5.9.3development
web-vitals
Environment
{
  "local_name": "web-vitals",
  "alias": false,
  "peer_metadata": null
}
^4.2.0development
@babel/core
Environment
{
  "local_name": "@babel/core",
  "alias": false,
  "peer_metadata": null
}
^7.29.0development
@types/jest
Environment
{
  "local_name": "@types/jest",
  "alias": false,
  "peer_metadata": null
}
^29.5.14development
@types/node
Environment
{
  "local_name": "@types/node",
  "alias": false,
  "peer_metadata": null
}
^16.18.126development
html2canvas
Environment
{
  "local_name": "html2canvas",
  "alias": false,
  "peer_metadata": null
}
^1.4.1development
@craco/craco
Environment
{
  "local_name": "@craco/craco",
  "alias": false,
  "peer_metadata": null
}
^7.1.0development
@svgr/rollup
Environment
{
  "local_name": "@svgr/rollup",
  "alias": false,
  "peer_metadata": null
}
^8.1.0development
@types/react
Environment
{
  "local_name": "@types/react",
  "alias": false,
  "peer_metadata": null
}
^19.2.9development
react-scripts
Environment
{
  "local_name": "react-scripts",
  "alias": false,
  "peer_metadata": null
}
5.0.1development
react-chartjs-2
Environment
{
  "local_name": "react-chartjs-2",
  "alias": false,
  "peer_metadata": null
}
^5.3.0development
@types/react-dom
Environment
{
  "local_name": "@types/react-dom",
  "alias": false,
  "peer_metadata": null
}
^19.2.3development
@babel/preset-env
Environment
{
  "local_name": "@babel/preset-env",
  "alias": false,
  "peer_metadata": null
}
^7.29.0development
rollup-plugin-dts
Environment
{
  "local_name": "rollup-plugin-dts",
  "alias": false,
  "peer_metadata": null
}
^6.3.0development
styled-components
Environment
{
  "local_name": "styled-components",
  "alias": false,
  "peer_metadata": null
}
^6.3.8development
@rollup/plugin-url
Environment
{
  "local_name": "@rollup/plugin-url",
  "alias": false,
  "peer_metadata": null
}
^8.0.2development
@babel/preset-react
Environment
{
  "local_name": "@babel/preset-react",
  "alias": false,
  "peer_metadata": null
}
^7.28.5development
@rollup/plugin-json
Environment
{
  "local_name": "@rollup/plugin-json",
  "alias": false,
  "peer_metadata": null
}
^6.1.0development
@rollup/plugin-alias
Environment
{
  "local_name": "@rollup/plugin-alias",
  "alias": false,
  "peer_metadata": null
}
^6.0.0development
@rollup/plugin-babel
Environment
{
  "local_name": "@rollup/plugin-babel",
  "alias": false,
  "peer_metadata": null
}
^6.1.0development
@testing-library/dom
Environment
{
  "local_name": "@testing-library/dom",
  "alias": false,
  "peer_metadata": null
}
^10.4.1development
@types/styled-system
Environment
{
  "local_name": "@types/styled-system",
  "alias": false,
  "peer_metadata": null
}
^5.1.23development
@vitejs/plugin-react
Environment
{
  "local_name": "@vitejs/plugin-react",
  "alias": false,
  "peer_metadata": null
}
^6.0.1development
@rollup/plugin-terser
Environment
{
  "local_name": "@rollup/plugin-terser",
  "alias": false,
  "peer_metadata": null
}
^0.4.4development
rollup-plugin-postcss
Environment
{
  "local_name": "rollup-plugin-postcss",
  "alias": false,
  "peer_metadata": null
}
^4.0.2development
@rollup/plugin-replace
Environment
{
  "local_name": "@rollup/plugin-replace",
  "alias": false,
  "peer_metadata": null
}
^6.0.3development
@testing-library/react
Environment
{
  "local_name": "@testing-library/react",
  "alias": false,
  "peer_metadata": null
}
^16.3.2development
@rollup/plugin-commonjs
Environment
{
  "local_name": "@rollup/plugin-commonjs",
  "alias": false,
  "peer_metadata": null
}
^29.0.0development
@types/styled-components
Environment
{
  "local_name": "@types/styled-components",
  "alias": false,
  "peer_metadata": null
}
^5.1.36development
@rollup/plugin-typescript
Environment
{
  "local_name": "@rollup/plugin-typescript",
  "alias": false,
  "peer_metadata": null
}
^12.3.0development
@testing-library/jest-dom
Environment
{
  "local_name": "@testing-library/jest-dom",
  "alias": false,
  "peer_metadata": null
}
^6.9.1development
@rollup/plugin-node-resolve
Environment
{
  "local_name": "@rollup/plugin-node-resolve",
  "alias": false,
  "peer_metadata": null
}
^16.0.3development
@testing-library/user-event
Environment
{
  "local_name": "@testing-library/user-event",
  "alias": false,
  "peer_metadata": null
}
^14.6.1development
rollup-plugin-node-polyfills
Environment
{
  "local_name": "rollup-plugin-node-polyfills",
  "alias": false,
  "peer_metadata": null
}
^0.2.1development
rollup-plugin-peer-deps-external
Environment
{
  "local_name": "rollup-plugin-peer-deps-external",
  "alias": false,
  "peer_metadata": null
}
^2.2.4development
react
Environment
{
  "local_name": "react",
  "alias": false,
  "peer_metadata": null
}
^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.2.3peer
react-dom
Environment
{
  "local_name": "react-dom",
  "alias": false,
  "peer_metadata": null
}
^16.14.0 || ^17.0.0 || ^18.0.0 || ^19.2.3peer
styled-components
Environment
{
  "local_name": "styled-components",
  "alias": false,
  "peer_metadata": null
}
^6.0.0peer

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "shasum": "7ab70e65674f219d38f40a4b0330f38d828942c8",
  "tarball": "https://registry.npmjs.org/54pay-payments-sdk/-/54pay-payments-sdk-1.0.7.tgz",
  "fileCount": 6,
  "integrity": "sha512-zwClaED8JnLn0GbcXJ9iyBTJAoAZZowgH0hgF0E0FWZYNE6BNQHwzaRThrOBZSH4T4vlF4rbLTgygbbqyT1HjQ==",
  "signatures": [
    {
      "sig": "MEUCIQDIqK05oLU43BwBlQ4SMPYAc+rEJLG5mPiamXWNUHWISgIgARh5FKOlTTWPkh5JvFa/bkMUJbb6Js6BMpoo84evVkw=",
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"
    }
  ],
  "unpackedSize": 5990747
}

Repository

PENDING
mypaygate/web-sdk

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 20:25 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:cdba37eb2d4789c5cfba273b60f666e38e4708775a16ccf3fe1a4ef3026e75a0

Other collected versions

1.1.38 Oct1.1.217 Sept1.1.115 Sept1.1.08 Sept1.0.1128 Aug1.0.1027 AugView all collected versions →