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

@sanlo/checkout-web

v0.0.7

Published

Sanlo Checkout Web SDK

Readme

Sanlo Checkout Web SDK

Sanlo Checkout is an online payment checkout library for your Node project, supporting payments from around the world. More infomation here: https://www.sanlo.ai/

Installation

  1. Make sure your Node project is setup correctly, please reference NPM Installation guide

  2. In your project folder, run command: npm install @sanlo/checkout-web

  3. Implement Sanlo Checkout into your project, here is an example implementation:

<!doctype html>
<html lang="en">
  <head>
    <title>Your Game</title>
  </head>
  <body>
	  <!-- Button that will be used to trigger instantiation of SanloCheckout -->
    <button id="trigger-checkout">Start Checkout</button>
  </body>
</html>

<script>
import SanloCheckout from '@sanlo/checkout-web';
import "@sanlo/checkout-web/dist/style.css";

const checkout = new SanloCheckout({
  // This is the session data from the BE session API, please refer to step 1 in https://developer.sanlo.ai/docs/sanlo-checkout
  sesssion: {
    id: "YOUR_SESSION_ID",  // Optional - omit this line if not setting Session ID
    token: "YOUR_SESSION_TOKEN"  // Required
  }
  // Example reference to the HTML element
  node: document.getElementById('checkout-container'),
  onSessionUpdate: (data) => {
    console.log('onSessionUpdate', data);
  },
  onCheckoutError: (error) => {
    console.log('onCheckoutError', error);
  },
  onPurchaseSuccess: (data) => {
    console.log("onPurchaseSuccess", data);
    // Once you've received this callback, you may reward your player the bought item(s)
  },
  onPurchaseError: (error) => {
    console.log("onPurchaseError", error);
  },
  onReady: () => {
    console.log("onReady");
  },
  onEnd: () => {
    console.log("onEnd");
    // Use this callback to trigger your own events after checkout has finished
  }
  // This style section is optional, will override styles generated from our
  // dashboard Checkout Builder
  ,
  style: {
    logo: "logo.png",
    colors: {
        primary: "#FF0000",
        secondary: "#00FF00",
      },
      backgrounds: {
        payments: "#000000",
        summary: "#FFFFFF",
      }
  }
  // End Style
});
</script>
  1. OPTIONAL - Implement a UI preview: A method to preview a large chunk of the UI without needing a valid payment session. UI only, works well with Storybook.
import { SanloCheckoutPreview } from '@sanlo/checkout-web';

<SanloCheckoutPreview
  user: {
    email: "[email protected]",
    zip: "12345",
  },
  item: {
    "externalId": "item-external-id",
    "name": "Item Name",
    "description": "",
    "iconUrl": "iconUrl.png",
  },
  priceData: {
    "price": {
      "label": "Sub Total:",
      "amount": "$ 2.09",
    },
    "tax": {
      "label": "Tax:",
      "amount": "$ 0.42",
    },
    "vat": null,
    "total": {
      "label": "Total:",
      "amount": "$ 2.51",
    }
  },
  paymentMethods: [
    {
      "name": "Cards",
      "type": "scheme",
      "paymentKey": "cards"
    },
    {
      "name": "Google Pay",
      "type": "googlepay",
      "paymentKey": "googlepay"
    }
  ],
  style: {
    logo: "logo.png",
    colors: {
      primary: "#FF0000",
      secondary: "#00FF00",
    },
    backgrounds: {
      payments: "#a2a2eb",
      summary: "#f4c463",
    },
  }
/>
  1. Done with setup, now run the project however you would normally. For example, in your project folder run the command: npm run dev

Useful Links:

https://www.sanlo.ai