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

@w3-payments/core

v1.0.0

Published

React component library for universal Web3 payment processing with multi-vendor support

Readme

W3 Payments Core

NPM Version Bundle Size TypeScript License

React component library for universal Web3 payment processing.

Installation

npm install @w3-payments/core
# or
pnpm add @w3-payments/core

Usage

Basic Integration

import { W3PaymentsProvider, W3PaymentWidget } from '@w3-payments/core';

function App() {
  const vendorConfig = {
    meshpay: { enabled: true, clientId: 'your-client-id' },
    ironpay: { enabled: true, apiKey: 'your-api-key' }
  };

  return (
    <W3PaymentsProvider 
      vendorConfig={vendorConfig}
      supportedCurrencies={['BTC', 'ETH-ETH', 'BNB-BSC']}
    >
      <W3PaymentWidget 
        amount={100}
        currency="BTC"
        onPaymentSuccess={(result) => console.log('Payment successful!', result)}
        onVendorSelect={(vendor) => console.log('Vendor selected:', vendor.name)}
      />
    </W3PaymentsProvider>
  );
}

CommonJS Support

const { W3PaymentsProvider, W3PaymentWidget } = require('@w3-payments/core');

Theming and Customization

Automatic CSS Inclusion

The library automatically includes its CSS styles when imported. No manual CSS imports are needed:

import { W3PaymentsProvider } from '@w3-payments/core';
// CSS styles are automatically injected!

W3 Brand Colors

The library provides W3 brand colors as CSS custom properties that can be customized:

:root {
  /* W3 Brand Colors - Customizable */
  --color-w3-primary: #2563eb;    /* Primary blue */
  --color-w3-secondary: #64748b;  /* Secondary gray */
  --color-w3-background: #ffffff; /* Background white */
  --color-w3-border: #e2e8f0;     /* Border light gray */
}

Custom Theming

Override the default colors by defining CSS custom properties in your application:

/* Light theme */
:root {
  --color-w3-primary: #10b981;      /* Green primary */
  --color-w3-secondary: #6b7280;    /* Custom secondary */
  --color-w3-background: #f8fafc;   /* Light background */
  --color-w3-border: #d1d5db;       /* Custom border */
}

/* Dark theme */
[data-theme="dark"] {
  --color-w3-primary: #34d399;      /* Bright green for dark */
  --color-w3-secondary: #9ca3af;    /* Lighter secondary for dark */
  --color-w3-background: #1f2937;   /* Dark background */
  --color-w3-border: #374151;       /* Dark border */
}

Theme Integration Examples

Basic Color Override

:root {
  --color-w3-primary: #your-brand-color;
}

Multiple Brand Colors

:root {
  --color-w3-primary: #ff6b6b;      /* Red primary */
  --color-w3-secondary: #4ecdc4;    /* Teal secondary */
  --color-w3-background: #ffe66d;   /* Yellow background */
  --color-w3-border: #ff8b94;       /* Pink border */
}

Dynamic Theme Switching

// Toggle between light and dark themes
function toggleTheme() {
  const isDark = document.documentElement.getAttribute('data-theme') === 'dark';
  document.documentElement.setAttribute('data-theme', isDark ? 'light' : 'dark');
}

CSS Bundle Information

  • CSS Size: 8.27 kB (2.37 kB gzipped) - well under 15kb limit
  • Tree-shaking: Only used utility classes included in final bundle
  • Minification: CSS is automatically minified for production
  • Custom Properties: Full support for CSS custom property theming

Build Information

  • Format: ES Modules (.mjs) and CommonJS (.js)
  • Bundle Size: < 50kb gzipped total (JS + CSS)
  • Tree-shaking: Supported for individual component imports
  • TypeScript: Full type definitions included
  • CSS: Automatically injected, no manual imports needed

Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type-aware lint rules:

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...

      // Remove tseslint.configs.recommended and replace with this
      tseslint.configs.recommendedTypeChecked,
      // Alternatively, use this for stricter rules
      tseslint.configs.strictTypeChecked,
      // Optionally, add this for stylistic rules
      tseslint.configs.stylisticTypeChecked,

      // Other configs...
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])

You can also install eslint-plugin-react-x and eslint-plugin-react-dom for React-specific lint rules:

// eslint.config.js
import reactX from 'eslint-plugin-react-x'
import reactDom from 'eslint-plugin-react-dom'

export default defineConfig([
  globalIgnores(['dist']),
  {
    files: ['**/*.{ts,tsx}'],
    extends: [
      // Other configs...
      // Enable lint rules for React
      reactX.configs['recommended-typescript'],
      // Enable lint rules for React DOM
      reactDom.configs.recommended,
    ],
    languageOptions: {
      parserOptions: {
        project: ['./tsconfig.node.json', './tsconfig.app.json'],
        tsconfigRootDir: import.meta.dirname,
      },
      // other options...
    },
  },
])