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

@zypay/react-sdk

v1.0.1

Published

Zypay React SDK for blockchain payment processing

Downloads

5

Readme

Zypay React SDK

A comprehensive React SDK for blockchain payment processing with support for multiple blockchains including TON and BSC.

Features

  • 🔗 Multi-blockchain support - TON, BSC, and more
  • 💳 Payment processing - Secure transaction handling
  • 🎨 Modern UI components - Beautiful, responsive payment interface
  • 🔒 Security first - Built with security best practices
  • 📱 Mobile responsive - Works seamlessly on all devices
  • 🚀 TypeScript support - Full type safety
  • Real-time updates - Live payment status updates
  • 🎯 Easy integration - Simple React hooks API

Installation

npm install @zypay/react-sdk

or

yarn add @zypay/react-sdk

Quick Start

import React from 'react';
import { useZypay } from '@zypay/react-sdk';

function App() {
  const { initializePayment, PaymentModal } = useZypay({
    token: 'your-api-token',
    config: {
      hostUrl: 'https://api.zypay.app',
      debug: true
    }
  });

  const handlePayment = async () => {
    await initializePayment('user-id');
  };

  return (
    <div>
      <button onClick={handlePayment}>
        Make Payment
      </button>
      <PaymentModal />
    </div>
  );
}

export default App;

Configuration

Basic Configuration

const { initializePayment, PaymentModal } = useZypay({
  token: 'your-api-token',
  config: {
    hostUrl: 'https://api.zypay.app',
    timeout: 30000,
    retryAttempts: 3,
    debug: {
      enabled: true,
      level: 'info',
      logNetwork: true,
      logState: true,
      logPerformance: false
    }
  }
});

Environment Variables

You can also configure the SDK using environment variables:

ZYPAY_HOST_URL=https://api.zypay.app
NODE_ENV=production

API Reference

useZypay Hook

The main hook for integrating Zypay payments into your React application.

Parameters

  • token (string): Your Zypay API token
  • config (object, optional): Configuration options
    • hostUrl (string): API host URL
    • timeout (number): Request timeout in milliseconds
    • retryAttempts (number): Number of retry attempts
    • debug (boolean | DebugConfig): Debug configuration

Returns

  • initializePayment(userId: string): Initialize payment for a user
  • PaymentModal: React component for payment interface
  • disconnect(): Disconnect from the payment service
  • reconnect(): Reconnect to the payment service
  • state: Current payment state

Payment States

The SDK manages various payment states:

  • idle: Initial state
  • loading: Loading payment options
  • selecting: User selecting payment options
  • processing: Payment being processed
  • pending: Payment pending confirmation
  • confirmed: Payment confirmed
  • expired: Payment expired
  • failed: Payment failed
  • cancelled: Payment cancelled

Error Handling

const { state } = useZypay({ token: 'your-token' });

if (state.error) {
  console.error('Payment error:', state.error);
  // Handle error
}

Supported Blockchains

  • TON - The Open Network
  • BSC - Binance Smart Chain
  • More blockchains coming soon!

Debug Configuration

The SDK includes comprehensive debug logging capabilities:

Debug Options

const { initializePayment, PaymentModal } = useZypay({
  token: 'your-api-token',
  config: {
    debug: {
      enabled: true,           // Enable debug logging
      level: 'info',          // Log level: 'error', 'warn', 'info', 'debug'
      timestamps: true,       // Include timestamps in logs
      includeComponent: true, // Include component names in logs
      logNetwork: true,       // Log network requests and responses
      logState: true,         // Log state changes
      logPerformance: false,  // Log performance metrics
      logger: (level, message, data) => {
        // Custom logger function
        console.log(`[${level}] ${message}`, data);
      }
    }
  }
});

Simple Debug Configuration

// Simple boolean configuration
const { initializePayment, PaymentModal } = useZypay({
  token: 'your-api-token',
  config: {
    debug: true  // Enables debug with default settings
  }
});

Debug Features

  • Network Logging: Logs all socket events, requests, and responses
  • State Tracking: Logs all state changes with before/after values
  • Performance Metrics: Measures and logs operation timings
  • Error Tracking: Detailed error logging with context
  • Data Sanitization: Automatically redacts sensitive information
  • Custom Loggers: Support for custom logging implementations

Security

The Zypay React SDK is built with security in mind:

  • All API communications are encrypted
  • Tokens are securely handled
  • No sensitive data is stored locally
  • Regular security audits and updates

Development

Prerequisites

  • Node.js 16+
  • npm 8+

Setup

git clone https://github.com/zypay/react-sdk.git
cd react-sdk
npm install

Build

npm run build

Development

npm run dev

Linting

npm run lint
npm run lint:fix

Type Checking

npm run type-check

Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Changelog

See CHANGELOG.md for a list of changes and version history.


Made with ❤️ by the Zypay Team