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

@payhos/api

v2.5.0

Published

An API package for payhos's API built for JavaScript and Typescript developers

Readme

PayHos API SDK

PayHos is an easy go-to solution for many day-to-day application problems by providing an easily access to send emails, SMS etc. For a full documentations of PayHos API and fully supported features, visit PayHos API Docs.

This API SDK is intended to assist web applications of any kind to interact with the PayHos API server by utilizing its simple schematics. For a more modular usage, this library is designed such that bundlers with tree-shaking is enhanced.

PayHos API SDK

PayHos provides a small client SDK to interact with the PayHos API for sending email, SMS and requesting prerendered HTML pages.

Install

npm install @payhos/api --save

SMS

Use the sms helper to send messages.

import { PayHos } from "@payhos/api";
const payhos = new PayHos("<YOUR_API_TOKEN>");

await payhos.sms.send({
  message: "Hello from PayHos",
  recipients: ["+1234567890"],
  senderId: "PayHos",
});

Email

Use the email helper to send emails.

import { PayHos } from "@payhos/api";
const payhos = new PayHos("<YOUR_API_TOKEN>");

await payhos.email.send({
  subject: "Hi",
  html: "<p>Hello</p>",
  recipients: [{ email: "[email protected]", name: "Jane" }],
  sender: { name: "PayHos", email: "[email protected]" },
});

Prerender

Use the prerender helper to request a pre-rendered HTML snapshot of a URL.

import { PayHos } from "@payhos/api";
const payhos = new PayHos("<YOUR_API_TOKEN>");

const resp = await payhos.prerender.page({
  url: "https://example.com",
  cacheMs: 86400000,
});
console.log(resp.data);

AI

Use the ai helper to send prompts to PayHos AI API.

import { PayHos } from "@payhos/api";
const payhos = new PayHos("<YOUR_API_TOKEN>");

const resp = await payhos.ai.prompt({
  prompt: "Write a short release note for a payments API update.",
});

if (resp.success && resp.data) {
  console.log(resp.data.response);
  console.log(resp.data.usage.totalChars, resp.data.usage.cost);
}

AI provider selection

const geminiResp = await payhos.ai.prompt({
  prompt: "Summarize this in 3 bullets",
  provider: "gemini", // default if omitted
  model: "gemini-2.0-flash-lite",
  temperature: 0.6,
  maxInputChars: 4000,
  maxOutputChars: 1200,
});

const gptResp = await payhos.ai.prompt({
  prompt: "Create a concise onboarding checklist.",
  provider: "gpt",
  model: "gpt-4o-mini",
});

AI billing

  • Rate: 0.003 USD per 1000 characters
  • Metering basis: prompt characters + response characters
  • Usage details are returned in data.usage
// Example usage payload shape
// {
//   inputChars: number,
//   outputChars: number,
//   totalChars: number,
//   cost: number,
//   ratePer1000Chars: number
// }

For full API details, see https://docs.payhos.com.