hebe-api

Unofficial library for programmatic access to your Hebe account and your orders


License
MIT
Install
npm install hebe-api@1.0.2

Documentation

hebe-api

Unofficial library for programmatic access to your Hebe account and your orders.

Python equivalent can be found at the hebe-api pypi package

▶️ Use

Install the package

yarn add hebe-api

or

npm install hebe-api

📖 Getting Started

Importing

Once it has been installed, it can easily be imported in your project, depending on the import method you need.

// Common js module
const { Hebe } = require("hebe-api");
// ESM module
import { Hebe } from "hebe-api";

Usage

Obtaining Hebe security token

const hebe = new Hebe({
    username: "HEBE_USERNAME",
    password: "HEBE_PASSWORD"
});
await hebe.authenticate();
console.log(hebe.token)
// T2a...................

You can also provide credentials later:

const hebe = new Hebe();
await hebe.authenticate({
    username: "HEBE_USERNAME",
    password: "HEBE_PASSWORD"
});
console.log(hebe.token)
// E9U...................

Obtaining user orders

const orders = await hebe.getOrders({ maxOrders: 1 });

Obtaining order's products

const orders = await hebe.getOrders({ maxOrders: 1 });
const products = await hebe.getProducts(orders[0]);

Obtaining all products

const products = await hebe.getAllProducts();

💻 Development

If you want to improve the package or you are just curious on how it works, follow this section.

🧾 Requirements

  • node.js 18.x (but earlier will prob work too.)
  • npm (or similar package manager)

Notable dev-dependencies

🔧 Development setup

Install the dependencies with

yarn

🧱 Build

Make sure everything is clean by running

yarn clean

then all the versions of the package can be built with the command

yarn build

🧪 Tests

Unit

After having installed the dependencies, run

yarn test