A simple wrapper around the Tixte API with typings
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);
Account info related:
// Getting user information
await tixteClient.getUserInfo();
// Get user registered domains (not support 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 });
// Updating a file, such as changing it's name or extension
await tixteClient.updateFile(id, { name?, extension? });
// Deleting a file
await tixteClient.deleteFile(id);
If you have any requests or issues, you can open an issue on GitHub or you can contact me through discord at Exhabition#0448