Unofficial library for programmatic access to your Hebe account and your orders.
Python equivalent can be found at the hebe-api pypi package
Install the package
yarn add hebe-api
or
npm install hebe-api
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";
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...................
const orders = await hebe.getOrders({ maxOrders: 1 });
const orders = await hebe.getOrders({ maxOrders: 1 });
const products = await hebe.getProducts(orders[0]);
const products = await hebe.getAllProducts();
If you want to improve the package or you are just curious on how it works, follow this section.
- node.js 18.x (but earlier will prob work too.)
- npm (or similar package manager)
- typescript to make programming decent
- jest.js for unit tests
Install the dependencies with
yarn
Make sure everything is clean by running
yarn clean
then all the versions of the package can be built with the command
yarn build
After having installed the dependencies, run
yarn test