A Node.js client for the Tebex REST API written in Typescript. Easily interact with the Tebex REST API using this library.
npm install --save tebex.js
Get your tebex secret at https://tebex.io
You can use TebexClient
to generate an instance of the Tebex REST API, or you can use the TebexRest
to interact with the Tebex REST API without creating a new instance.
All the methods are documented with their respective types.
Using a TebexClient
instance
import { TebexClient } from 'tebex.js';
const TEBEX_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
const client = new TebexClient(TEBEX_SECRET);
// Use client to fetch information
(async () => {
const information = await client.information();
console.log(information)
})();
Using TebexRest
import { TebexRest } from 'tebex.js';
const TEBEX_SECRET = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
// Use rest to fetch an specific endpoint
(async () => {
const information = await TebexRest(TEBEX_SECRET).information();
console.log(information)
})();
The TebexClient
and TebexRest
returns an object based on the interface ITebexRest
, it contains properties based on the Tebex API endpoints
The endpoints could give an error based on an Invalid Tebex Secret, Not found object or a Server error (Which shouldn't happen as the UknownError.)
They extend the BaseApiError
which has the message
and name
property.
You can check out the documentation for more detailed documentation
Feel free to help! If you're interested in helping with the project, please take a look at our issues tracker
You can check the official documentation API to see the HTTP API. This package uses the official endpoints.