Skip to content

PineAppleGrits/tebex.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tebex.js

A Node.js client for the Tebex REST API written in Typescript. Easily interact with the Tebex REST API using this library.

npm GitHub Repo stars npm bundle size GitHub code size in bytes GitHub commit activity (branch) GitHub issues GitHub top language

🚀 Installation

npm install --save tebex.js

🗒️ Getting started

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.

⚒️ Usage

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)
})();

🤖 API

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

🌍 Contribute

Feel free to help! If you're interested in helping with the project, please take a look at our issues tracker

✨ More

You can check the official documentation API to see the HTTP API. This package uses the official endpoints.

About

⚡ A Node.js client for the Tebex REST API written in Typescript.\ https://www.npmjs.com/package/tebex.js

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published