1.7.0 • Published 6 days ago

tebex_headless v1.7.0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 days ago

Tebex Headless API Wrapper

Tebex Headless

Welcome to the Tebex Headless API Wrapper! This Node.js TypeScript library allows you to seamlessly integrate Tebex into your projects and build a custom storefront without revealing your use of Tebex.

Installation

npm install tebex_headless

Getting Started

  1. Obtain your Tebex Headless API public token from your Tebex account.
  2. Install the tebex_headless library in your project.
  3. Start using the Tebex Headless API in your Node.js TypeScript application!
import { SetWebstoreIdentifier } from "tebex_headless";

SetWebstoreIdentifier("your_public_token")

Functions

// Get all categories of the webstore
async GetCategories(includePackages?: boolean, basketIdent?: string, ip_address?: string)

// Get a specific category by an id
async GetCategory(id: number, includePackages?: boolean, basketIdent?: string, ip_address?: string)

// Apply a coupon, gift card, or creator code
async Apply<T extends ApplyType, A extends ApplyTypeToInterface<T>>(basketIdent: string, type: T, body: A)

// Remove a coupon, gift card, or creator code
async Remove<T extends ApplyType, A extends ApplyTypeToInterface<T>>(basketIdent: string, type: T, body: A)

// Get a specific package by an id inside a basket
async GetPackage(id: number, basketIdent?: string, ip_address?: string)

// Get all packages of the webstore inside a basket
async GetPackages(basketIdent?: string, ip_address?: string)

// Get a basket by an identifier
async GetBasket(basketIdent: string)

// Create a basket and provide complete and cancel URLs
async CreateBasket(complete_url: string, cancel_url: string, custom?: KeyValuePair<string, any>, complete_auto_redirect?: boolean, ip_address?: string)

// Create a minecraft basket and provide a username
async CreateMinecraftBasket(username: string, complete_url: string, cancel_url: string, custom?: KeyValuePair<string, any>, complete_auto_redirect?: boolean, ip_address?: string)

// Get all auth URLs by a basket
async GetBasketAuthUrl(basketIdent: string, returnUrl: string)

// Add a package to a specific basket
AddPackageToBasket(basketIdent: string, package_id: number, quantity: number, type: PackageType, variable_data?: KeyValuePair<string, any>)

// Gift a package to a target user
async GiftPackage(basketIdent: string, package_id: number, target_username_id: string)

// Remove a package inside a specific basket and package_id
async RemovePackage(basketIdent: string, package_id: number)

// Update the quantity of a package inside a basket
async UpdateQuantity(basketIdent: string, package_id: number, quantity: number)

// Get webstore information by the public token
async GetWebstore()

Features

  • Seamless Integration: Use Tebex functionalities in your project without exposing the fact that you are using Tebex.
  • Custom Storefront: Build your custom storefront by leveraging Tebex Headless API.

IP forwarding

If a store uses its own backend but wants to use the IP addresses of the users instead of the server, Tebex requires a basic authentication.

Check our following Link to generate a private key

import { SetWebstoreIdentifier, SetPrivateKey } from "tebex_headless";

SetWebstoreIdentifier("your_public_token")
SetPrivateKey("your_private_key")

Contributing

We welcome contributions from the community! If you'd like to contribute to this project, please follow these steps:

  1. Fork the repository.
  2. Create a new branch for your feature or bug fix.
  3. Make your changes and ensure tests pass.
  4. Submit a pull request with a clear description of your changes.

Documentation

Check out the official Tebex documentation for detailed information about the Tebex Headless API and its features.

Support

If you have questions or need assistance, feel free to open an issue on the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.


Happy coding! 🚀

1.7.0

6 days ago

1.6.2

5 months ago

1.6.1

5 months ago

1.6.0

5 months ago

1.5.0

5 months ago

1.4.0

5 months ago

1.3.7

5 months ago

1.3.6

5 months ago

1.3.5

5 months ago

1.3.4

5 months ago

1.3.3

5 months ago

1.3.2

5 months ago

1.3.1

5 months ago

1.3.0

5 months ago

1.2.0

5 months ago

1.1.1

5 months ago

1.1.0

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago