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

react-remita-payment

v1.3.9

Published

A modern React component for processing Remita payments with robust SSR support for Next.js and other frameworks, using their inline script with security best practices

Downloads

9

Readme

React Remita Payment

A modern, secure React component library for processing payments using Remita's inline payment script with TypeScript support and comprehensive security features.

npm version License: MIT Build Status

Features

  • 🔒 Security First: Built with security best practices, input validation, and data sanitization
  • 🎯 TypeScript Support: Full TypeScript support with comprehensive type definitions
  • 🧪 Thoroughly Tested: High test coverage with Jest and React Testing Library
  • 🎨 Customizable: Flexible styling and custom button content support
  • 📱 Responsive: Works seamlessly across different screen sizes
  • 🔧 Developer Friendly: Easy to integrate with clear API and helpful error messages
  • 🌍 Environment Support: Separate demo and live environments
  • High-Value Protection: Built-in confirmation for high-value transactions to prevent accidental payments
  • �🖥️ Framework Agnostic: Works with React, Next.js, Remix, and other frameworks with robust SSR support

Server-Side Rendering Support

This package has first-class support for SSR frameworks like Next.js, Remix, and others. It handles hydration safely and ensures payment components only activate in the browser.

Next.js Usage

The package works directly in Next.js apps without any special wrapper components:

"use client"; // If using App Router

import {
  RemitaPayment,
  RemitaConfig,
  PaymentRequest,
} from "react-remita-payment";

export default function PaymentPage() {
  const config: RemitaConfig = {
    publicKey: process.env.NEXT_PUBLIC_REMITA_PUBLIC_KEY,
    serviceTypeId: "your-service-type-id",
  };

  const paymentData: PaymentRequest = {
    amount: 5000,
    email: "[email protected]",
    firstName: "John",
    lastName: "Doe",
    transactionId: "TXN-123456",
    narration: "Payment for services",
  };

  const handleSuccess = (response) => {
    console.log("Payment successful", response);
  };

  return (
    <div>
      <h1>Payment Page</h1>
      <RemitaPayment
        config={config}
        paymentData={paymentData}
        environment="live"
        onSuccess={handleSuccess}
        onError={(error) => console.error(error)}
        onClose={() => console.log("Payment closed")}
      >
        Pay ₦5,000
      </RemitaPayment>
    </div>
  );
}

How SSR Support Works

The package implements multiple safeguards for SSR environments:

  1. Deferred Script Loading: Scripts only load in the browser environment
  2. Safe Hydration: Component safely handles hydration to prevent React errors
  3. Progressive Enhancement: Component starts with a loading state until fully hydrated
  4. Multiple Environment Checks: Uses various techniques to verify browser environment
  5. Graceful Degradation: Falls back to safe states when browser features are unavailable

Version 1.3.3 Improvements

  • Enhanced script loading with multiple fallback mechanisms
  • Improved resilience to network and initialization issues
  • Better handling of engine initialization errors
  • Advanced debugging with detailed console logs
  • Preemptive script loading for faster payment initiation
  • Multiple retries with emergency fallback methods
  • Direct script injection when standard methods fail

Enhanced Script Loading

Version 1.3.4 introduces ultra-robust script loading mechanisms to handle even the most challenging environments:

  • 🔄 Multiple Loading Strategies: Uses parallel loading strategies to maximize success rate
  • 🧠 Smart Retries: Automatically attempts multiple strategies when standard loading fails
  • 📊 Detailed Logging: Provides comprehensive console logging for troubleshooting
  • 🛡️ Error Recovery: Implements sophisticated error recovery mechanisms
  • 🚀 Emergency Fallbacks: Includes last-resort loading techniques when standard methods fail

Troubleshooting Script Loading

If you encounter script loading issues:

  1. Check Console Logs: The package provides detailed console logs to help diagnose issues
  2. Network Restrictions: Ensure your network allows loading scripts from Remita domains
  3. Content Security Policy: If using CSP, allow scripts from remitademo.net and login.remita.net
  4. Browser Extensions: Some privacy/ad-blocking extensions may interfere with script loading
  5. Try Alternative Browser: If issues persist, try a different browser to narrow down the cause