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

@rinnebr/js

v0.1.0

Published

Modern payment elements library for Apple Pay, Google Pay, and other payment methods

Readme

@rinnebr/js

Payment elements for Rinne — Apple Pay, Google Pay, an encrypted card form, and 3D Secure — ready to drop into any web checkout.

Status: Closed Beta. APIs may break in any release until 1.0. Pin your version.

Documentation · Platform docs


Install

npm install @rinnebr/js
yarn add @rinnebr/js
pnpm add @rinnebr/js

Or via CDN (UMD bundle, exposes window.Rinne):

<script src="https://pkgs.rinne.com.br/[email protected]"></script>

Initialize

import { Rinne } from '@rinnebr/js'

const rinne = new Rinne({ merchantId: 'YOUR_MERCHANT_UUID', environment: 'sandbox' })

That's the entire setup. From here, mount any payment element.

Apple Pay

const tx = await rinne.transaction.create({
  amount:    1000,                                  // cents (BRL by default)
  lineItems: [{ amount: 1000, label: 'Order #1234' }],
})

const apple = await rinne.elements.applePay(tx, {
  button: { color: 'black', type: 'pay', borderRadius: 4 },
  onCapture: async ({ card_data, payment_method }, fail) => {
    const ok = await myBackend.charge({ card_data, payment_method })
    if (!ok) fail({ message: 'Payment was declined.' })
  },
  onError:  (err) => console.error(err),
  onCancel: () => {},
})

await apple.mount('#apple-pay')

Google Pay

const google = await rinne.elements.googlePay(tx, {
  button:      { color: 'black', type: 'pay', borderRadius: 4 },
  colorScheme: 'dark',                              // match your page theme
  onCapture: async ({ card_data, payment_method }, fail) => {
    const ok = await myBackend.charge({ card_data, payment_method })
    if (!ok) fail({ message: 'Payment was declined.' })
  },
  onError:  (err) => console.error(err),
  onCancel: () => {},
})

await google.mount('#google-pay')

rinne.transaction.create(...) produces one transaction that can drive both wallet buttons on the same page — the user picks one.

Card form

const card = await rinne.elements.card({
  theme:  'minimal',                                // 'clean' | 'minimal' | 'material' | custom
  locale: 'pt',                                     // 'pt' | 'en' | 'es'
  fields: ['name', 'number', 'expiry', 'cvc'],
  icons:  true,
  onChange: ({ isComplete, isValid }) => {
    submitButton.disabled = !isComplete || !isValid
  },
})

const mounted = await card.mount('#card')

// On submit, `mounted.values.card` has encrypted `number` and `cvv`,
// plus plaintext `expiry_month`, `expiry_year`, `last_digits`, `brand`,
// and `cardholder_name`. Field names match Rinne's API — forward as-is.

3D Secure

const threeDS = await rinne.elements.threeDSecure({
  theme:  'minimal',
  locale: 'pt',
  onSuccess: () => confirmTransaction(),
  onFailure: (err) => showRetry(err?.message),
  onError:   (err) => showHardError(err.message),
})

// Render as a full-page modal (default):
await threeDS.mount(tds_session_id)

// Or embed in a container of your choice:
const embedded = await rinne.elements.threeDSecure({
  target: '#challenge-frame',
  size:   { width: '500px', height: '600px' },
})
await embedded.mount(tds_session_id)

Re-mounting the same element with a new session id is supported — useful for retry after expiry without re-creating the element.

What you get

  • Apple Pay and Google Pay buttons with one consistent callback API (onCapture, onError, onCancel).
  • An encrypted card form — PAN and CVV stay ciphertext on your side.
  • 3D Secure challenges, modal or embedded, with success/failure/error callbacks.
  • Three theme presets (clean, minimal, material) plus full custom CSS with a responsive media() utility.
  • Optional brand icons, colorScheme matching your page, customizable button color/type/border radius.
  • Localized in pt, en, es.
  • Live validation state on the card form (isValid, isComplete, per-field errors).
  • ESM, CJS, and UMD builds; TypeScript declarations included.

Documentation

Full SDK reference, integration guides, error catalog, and runnable examples:

docs.rinne.com.br/rinne-js

Platform docs (REST API, webhooks, concepts): docs.rinne.com.br.

License

MIT.

Support

For integration help and questions, see docs.rinne.com.br/rinne-js or contact Rinne support via the channels listed there.

To report a security issue privately, email [email protected] with the subject prefix [security][rinne-js]. Please don't post security reports in any public channel.