#headless #api #api-key #public-api #packages #tokio #tebex

tebex_headless_rust

Wrapper library for Tebex's Headless API

4 releases

0.1.3 Dec 15, 2023
0.1.2 Dec 5, 2023
0.1.1 Dec 5, 2023
0.1.0 Dec 5, 2023

#16 in #headless

31 downloads per month

GPL-3.0-only

56KB
1K SLoC

Tebex Headless Wrapper

A wrapper library for Tebex's Headless API, aka creating the serverside for your headless Tebex webstore.

  • Fast: One of our main aims, both when choosing to do this in Rust, and choosing our dependencies, was the fact that this should be blazing fast.
  • Reliable: This should pretty much be as reliable as possible, as it is a straight/raw wrapper for all Tebex API calls.

Crates.io Documentation Discord chat

Overview

This is a simple but straight forward to use wrapper library for Tebex's Headless API. If you do not know what that is already, then please read this first.

Example

use tebex_headless_rust::handlers::{misc::set_public_api_key, package::get_all_packages};

// tokio is used to allow an async main function
#[tokio::main]
async fn main() {
    // set public api key
    set_public_api_key(String::from("public_api_key_tebex"));

    // fetch packages
    let packages = get_all_packages(None, None).await;

    match packages {
        // if packages successfully fetched
        Ok (packages) => {
            println!("Package amount: {}", packages.len());
        }

        // handle issue with fetching of packages
        Err (err) => {
            println!("Could not fetch pacakges: {}", err);
        }
    }
}

Todo

  • Some of the structs are empty as it the structure of them are unknown
  • Find some way to generate & use auth link via tests, as that would allow us to improve tests drastically

Issues, suggestions, etcetera

If you encounter an issue with our template, simply open an issue here

Contribution

We gladly accept all contributions, contributing can be done via forking this repo and then creating a PR.

Dependencies

~7–19MB
~258K SLoC