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

flintn-checkout

v0.0.3

Published

FlintN Payment SDK — drop-in iframe checkout for card payments and wallets with localization and theming.

Readme

flintn-checkout

FlintN Payment SDK — Iframe-based payment widget with postMessage communication.

Installation

npm install flintn-checkout

Quick Start

React

import { useFlintNPayment } from 'flintn-checkout/react';

function Checkout() {
  const { containerRef, isReady, paymentResult, error } = useFlintNPayment({
    config: {
      clientSessionId: 'your_client_session_id',
    },
    onPayment: (result) => {
      if (result.status === 'PAYMENT_SUCCESS') {
        console.log('Payment succeeded:', result.data);
      } else {
        console.log('Payment failed:', result.error);
      }
    },
    onExpressPayment: (result) => {
      console.log('Express payment:', result);
    },
  });

  return (
    <div style={{ display: 'flex', justifyContent: 'center' }}>
      <div ref={containerRef} style={{ width: '100%', height: '600px' }} />
    </div>
  );
}

Vanilla JavaScript

import { FlintNPayment } from 'flintn-checkout';

const payment = new FlintNPayment({
  config: {
    clientSessionId: 'your_client_session_id',
  },
  onPayment: (result) => {
    if (result.status === 'PAYMENT_SUCCESS') {
      console.log('Payment succeeded:', result.data);
    } else {
      console.log('Payment failed:', result.error);
    }
  },
  onExpressPayment: (result) => {
    console.log('Express payment:', result);
  },
  onReady: () => {
    console.log('Widget ready');
  },
  debug: true,
});

payment.mount('#payment-container');

// Cleanup when done
payment.unmount();

HTML

<!DOCTYPE html>
<html>
<head>
  <title>FlintN Checkout</title>
</head>
<body>
  <div id="payment-container" style="max-width: 440px; height: 600px; margin: 0 auto;"></div>

  <script type="module">
    import { FlintNPayment } from 'flintn-checkout';

    const payment = new FlintNPayment({
      config: {
        clientSessionId: 'your_client_session_id',
      },
      onPayment: (result) => {
        console.log('Payment result:', result);
      },
    });

    payment.mount('#payment-container');
  </script>
</body>
</html>

Configuration

| Option | Type | Required | Default | Description | |--------|------|----------|---------|-------------| | clientSessionId | string | ✅ | — | Client session ID from backend | | isCardHolderRequired | boolean | ❌ | true | Show cardholder name field | | successRedirectUrl | string | ❌ | — | Redirect URL after successful payment |

Note: isCardHolderRequired only applies when using Primer as the payment provider.

Callbacks

| Callback | Description | |----------|-------------| | onPayment | Fired when card payment completes (success or error) | | onExpressPayment | Fired when express payment completes (Apple Pay, Google Pay, PayPal) | | onReady | Fired when widget is loaded and ready | | onError | Fired on SDK initialization error |

React Hook Return Values

| Value | Type | Description | |-------|------|-------------| | containerRef | RefObject<HTMLDivElement> | Ref to attach to container element | | isReady | boolean | Widget is loaded and ready | | paymentResult | PaymentResult \| null | Result after payment attempt | | error | PaymentError \| null | SDK error if any |

Types

PaymentResult

interface PaymentResult {
  status: 'PAYMENT_SUCCESS' | 'PAYMENT_ERROR' | 'PAYMENT_CANCELLED';
  data?: string; // Payment ID on success
  error?: {
    code: string;
    message: string;
  };
}

PaymentError

interface PaymentError {
  code: string;
  message: string;
}

Supported Payment Methods

  • 💳 Credit/Debit Cards (Visa, Mastercard, Amex, Discover)
  • 🍎 Apple Pay
  • 🔵 Google Pay
  • 🟡 PayPal

Debug Mode

Enable debug logs in console:

// React
useFlintNPayment({
  config: { clientSessionId: '...' },
  debug: true,
});

// Vanilla JS
new FlintNPayment({
  config: { clientSessionId: '...' },
  debug: true,
});

Test Cards

| Card Number | Result | |-------------|--------| | 4111 1111 1111 1111 | Success | | 4000 0000 0000 0002 | Declined |

Use any future expiry date and any 3-digit CVV.

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT