Skip to content

A simple to use wrapper for the Tixte API including types

License

Notifications You must be signed in to change notification settings

Exhabition/Tixte-API-Wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tixte API Wrapper

A simple wrapper around the Tixte API with typings

How to get started

Install the wrapper

npm install tixte
// or
yarn add tixte

Initialize the client (replace YOUR_API_KEY with a valid API key of course)

const { Client } = require("tixte");
const tixteClient = new Client(YOUR_API_KEY);

// Already using a "Client" variable? Try exporting it under a custom name like this:
const { Client : TixteClient } = require("tixte");
const tixteClient = new TixteClient(YOUR_API_KEY);

Supported functions

Account info related:

// Getting user information
await tixteClient.getUserInfo();
// Get user registered domains (not supported with API key, use an account token instead)
await tixteClient.getDomains();
// Get total upload file size/limit
await tixteClient.getSize();

File related:

// Uploading a buffer to Tixte
await tixteClient.uploadFile(buffer, domain, { filename, extension, private? });
// Updating a file, such as changing it's name or extension
await tixteClient.updateFile(id, { name?, extension? });
// Deleting a file
await tixteClient.deleteFile(id);

Questions

If you have any requests or issues, you can open an issue on GitHub or you can contact me through discord at Exhabition#0448

About

A simple to use wrapper for the Tixte API including types

Resources

License

Stars

Watchers

Forks

Packages

No packages published