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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cloudhub-ev

v0.0.6

Published

CloudHub EV charging API SDK — park info, connector lookup, session start/stop, invoice payments.

Readme

CloudHub EV — Official EV Central System SDK

A simple and powerful TypeScript/JavaScript SDK for integrating with
CloudHub EV Central System APIs — charging parks, stations, connectors, sessions, and invoice payments.

npm package: https://www.npmjs.com/package/cloudhub-ev
API Host: https://api.cloudhub.mn
Protocol: REST API (Public)


📦 Installation

npm install cloudhub-ev
# or
yarn add cloudhub-ev

🚀 Quick Start

import { CloudEv } from "cloudhub-ev";

const cloud = new CloudEv({
  HOST: "https://api.cloudhub.mn",
  API_KEY: "YOUR_API_KEY",
  MERCHANT_ID: "YOUR_MERCHANT_ID"
});

async function main() {
  const parks = await cloud.info.list();
  console.log(parks);
}

main();

📘 API Overview

The SDK provides 3 main service groups:

| Group | Description | | ----------- | ------------------------------------ | | info | Park, station, connector, price info | | session | Start/stop charging sessions | | invoice | Confirm invoice payments |


📍 INFO API

List all EV parks

await cloud.info.list();

Get full park details

包含 Park → Stations → Connectors

await cloud.info.park("PARK_ID");

Find connector by QR

await cloud.info.connectorByQR("110A43120069=1");

Calculate charging price

await cloud.info.price({
  amount: 0,
  kWh: 16.3,
  connector_id: "CONNECTOR_ID"
});

⚡ SESSION API

Start session

const start = await cloud.session.start("CONNECTOR_ID");

Get session info

await cloud.session.info("SESSION_ID");

Stop session

await cloud.session.stop("SESSION_ID");

💳 INVOICE API

Confirm invoice payment

await cloud.invoice.pay({
  session_id: "SESSION_ID",
  invoice_id: "INVOICE_ID",
  paid_amount: 10000,
  tra_id: "TRX-12345678"
});

🧩 Full Example

import { CloudEv } from "cloudhub-ev";

const cloud = new CloudEv({
  HOST: "https://api.cloudhub.mn",
  API_KEY: "sk_live.xxxxx",
  MERCHANT_ID: "xxxxxx"
});

async function run() {
  // Park list
  console.log(await cloud.info.list());

  // Park detail
  console.log(await cloud.info.park("29996bca-..."));

  // Connector by QR
  console.log(await cloud.info.connectorByQR("110A43120069=1"));

  // Price calculate
  console.log(
    await cloud.info.price({
      amount: 0,
      kWh: 16.3,
      connector_id: "8daa0f30-..."
    })
  );

  // Start session
  const start = await cloud.session.start("8daa0f30-...");
  console.log(start);

  // Session info
  console.log(await cloud.session.info(start?.data?.session_id));

  // Stop session
  console.log(await cloud.session.stop(start?.data?.session_id));

  // Invoice pay
  console.log(
    await cloud.invoice.pay({
      session_id: "SESSION_ID",
      invoice_id: "INV-2025-0001",
      paid_amount: 12500,
      tra_id: "TRX-12345"
    })
  );
}

run();

📄 TypeScript Support

This package ships with full TypeScript types, including:

  • ParkType
  • StationT
  • ConnectorT
  • SessionStatusType
  • Invoice responses

🏗 Project Structure

src/
 ├─ index.ts         # CloudEv Class
 ├─ info.ts          # Park/Station/Connector APIs
 ├─ session.ts       # Charging session APIs
 ├─ invoice.ts       # Invoice payment API
 ├─ types.ts         # TS types

🔐 Authentication

All requests use the same API key:

x-api-key: YOUR_API_KEY

📮 Support

If you need help integrating CloudHub EV APIs:
Email: [email protected]
Github: https://github.com/togtokh-dev/cloud-ev


📜 License

MIT License (free to use)