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

@photonpay/cashierjs

v2.0.6

Published

Photon Enterprise SDK

Readme

@photonpay/cashierjs

Embedded crypto payment SDK for PhotonPay. Drop a secure cryptocurrency checkout into any website with a few lines of code.

Features

  • Crypto Payment — Accept cryptocurrency payments via an embedded checkout form
  • Embedded Checkout — Render a payment form inside an iframe on your page
  • Responsive — Auto-detects desktop / mobile, or set manually
  • Secure — All sensitive data handled inside an isolated iframe
  • TypeScript — Ships with full type definitions

Installation

# npm
npm install @photonpay/cashierjs

# yarn
yarn add @photonpay/cashierjs

# pnpm
pnpm add @photonpay/cashierjs

Or via CDN:

<script src="https://unpkg.com/@photonpay/cashierjs/dist/photon-sdk.umd.min.js"></script>

Quick Start

import { Photon } from '@photonpay/cashierjs'

// 1. Create a Photon instance with your app ID
const photon = new Photon('your_app_id', {
  environment: 'production',
  platform: 'desktop'
})

// 2. Initialize the embedded checkout for crypto payment
const checkout = await photon.initEmbeddedCheckout({
  container: '#checkout-container',
  clientSecret: 'cs_xxx',
  enabledMethods: ['cryptoPay'],
  locale: 'en',
  payMethod: 'cryptoPay',
  defaultExpandedGroup: 'cryptoPay'
})

// 3. Listen for events
checkout.on('ready', () => console.log('Checkout ready'))
checkout.on('complete', (result) => console.log('Payment completed', result))
checkout.on('error', (error) => console.error('Payment error', error))

// 4. Submit payment (e.g. on button click)
document.getElementById('pay-btn').addEventListener('click', () => {
  checkout.submit()
})

// 5. Clean up when done
checkout.destroy()

Configuration

const photon = new Photon('your_app_id', {
  environment: 'production',  // 'production' | 'pre' | 'uat' | 'sit' | 'dev' | 'local'
  platform: 'auto',           // 'auto' | 'desktop' | 'mobile'
  debug: false,               // Enable debug logging
  authCode: 'ac_xxx',         // Authorization code (if required)
})

| Option | Type | Default | Description | |--------|------|---------|-------------| | environment | string | 'production' | Target environment | | platform | string | 'auto' | Platform detection mode | | debug | boolean | false | Enable verbose console logging | | authCode | string | — | Authorization code for the session | | timeout | number | 600000 | Request timeout in ms |

Note: Non-production environments are only available when running on localhost or *.photontech.cc domains. External sites always resolve to production.

Embedded Checkout Options

const checkout = await photon.initEmbeddedCheckout({
  container: '#checkout',          // CSS selector or HTMLElement
  clientSecret: 'cs_xxx',         // Client secret from your server
  fetchClientSecret: async () => { // Or fetch it dynamically
    const res = await fetch('/api/create-session')
    const { clientSecret } = await res.json()
    return clientSecret
  },
  enabledMethods: ['cryptoPay'],
  locale: 'en',
  payMethod: 'cryptoPay',
  defaultExpandedGroup: 'cryptoPay',
  isShowPayInfo: true,
  onReady: (payload) => {},
  onComplete: (result) => {},
  onError: (error) => {},
  onBackToMerchant: (payload) => {},
})

Events

Listen to checkout lifecycle events:

checkout.on('ready', () => { /* Form loaded */ })
checkout.on('change', (data) => { /* Form data changed */ })
checkout.on('validation', (errors) => { /* Validation result */ })
checkout.on('submit_start', () => { /* Payment started */ })
checkout.on('complete', (result) => { /* Payment succeeded */ })
checkout.on('submit_error', (error) => { /* Payment failed */ })
checkout.on('resize', ({ height }) => { /* iframe resized */ })
checkout.on('back_to_merchant', () => { /* User clicked back */ })
checkout.on('error', (error) => { /* General error */ })

Methods

checkout.submit()

Trigger payment submission programmatically.

checkout.destroy()

Remove the checkout iframe and clean up all event listeners.

checkout.updateConfig(config)

Update checkout configuration after initialization.

checkout.mount(container)

Mount the checkout to a different container.

Browser Support

| Browser | Version | |---------|---------| | Chrome | 60+ | | Firefox | 55+ | | Safari | 12+ | | Edge | 79+ |

Module Formats

| Format | File | Use Case | |--------|------|----------| | ESM | dist/photon-sdk.esm.js | Vite, Webpack, Rollup | | CJS | dist/photon-sdk.cjs | Node.js, CommonJS | | UMD | dist/photon-sdk.umd.js | <script> tag, CDN |

License

MIT