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

@cauril/checkout-js

v0.1.0

Published

Cauril embedded checkout drop-in (@cauril/checkout-js). Browser-only; never imports server packages or PSP secrets.

Readme

@cauril/checkout-js

Embedded checkout drop-in for the Cauril payments API. Renders a payment form in your page, lets the buyer pay with the methods you enabled, and routes the underlying PSP for you.

Browser-only. Zero runtime dependencies — the PSP's own SDK is loaded on demand at runtime. Card data is entered in the PSP's element and tokenized client-side; it never touches your servers or Cauril (PCI SAQ-A).

npm install @cauril/checkout-js

Or load it straight from the CDN (no build step):

<script src="https://js.cauril.com/v1/checkout.js"></script>

How it works

  1. On your server, create a checkout session with the @cauril/node SDK and send its client_secret to the browser:

    const session = await cauril.checkout.sessions.create({
      amount: 5000, // minor units (cents)
      currency: "BRL",
      success_url: "https://shop.example/thanks",
      cancel_url: "https://shop.example/cart",
    });
    // → send session.client_secret to the client
  2. In the browser, mount the drop-in with that client_secret:

    import { Cauril } from "@cauril/checkout-js";
    // or, via the CDN <script>, use the global `Cauril`
    
    const checkout = Cauril.checkout({
      clientSecret, // from your server, never a secret API key
      appearance: { theme: "light", accent: "#0a7", radius: 8 },
    });
    
    checkout.on("completed", ({ payment_status }) => {
      window.location.href = "/thanks";
    });
    checkout.on("failed", ({ code, message }) => showError(message));
    
    await checkout.mount("#cauril-checkout");
    <div id="cauril-checkout"></div>

Options

Cauril.checkout({
  clientSecret,                 // required — from POST /v1/checkout/sessions
  baseUrl: "https://api.cauril.com", // default
  locale: "es" | "pt" | "en",   // overrides the session/browser locale
  appearance: {                 // controlled theming only (sanitized; no arbitrary CSS)
    theme: "light" | "dark",
    accent: "#0a7",             // primary-button color
    radius: 8,                  // px, clamped 0–24
    font: "system" | "serif" | "mono",
  },
  onComplete: "manual" | "redirect", // "manual" (default) emits `completed`; "redirect" navigates to success_url
});

Events

checkout.on(event, handler) returns an unsubscribe function.

| Event | Payload | |---|---| | ready | { session } — the public session loaded | | method_selected | { method } | | processing | — | | requires_action | { next_action } — e.g. 3DS / voucher / redirect | | completed | { payment_status } | | failed | { code, message } | | expired | — | | error | { code, message } |

A listener that throws never breaks the payment flow.

Notes

  • The buyer chooses a payment method (card, pix, wallet, …), never a processor — Cauril routes the PSP behind the scenes.
  • clientSecret is a per-session token, safe to expose to the browser. It is not an API key.
  • Full guides and API reference: cauril.com/docs.