Skip to content

The best TypeScript wrapper for Vprikol API you can find

License

Notifications You must be signed in to change notification settings

otomir23/vprikol-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vprikol-ts

Wrapper for Vprikol API with types, written in TypeScript.

📦 Installation

npm i vprikol-ts

or

yarn add vprikol-ts

📚 Example

import { VprikolAPI } from 'vprikol-ts';

// Create an instance of the API
const api = new VprikolAPI({ token: 'your_token' });

// Get a list of players in the fraction with ID 1 on the server with ID 1
api.members(1, 1).then(data => {
    // If the request was successful
    if (data.success === true) {
        // Print the list of players
        console.log(`
            List of players in the fraction '${data.data.fractionLabel}' on the server '${data.data.server}':
            ${Object.entries(data.data.players).map(([username, player]) => `${username} - ${player.rankLabel}`).join('\n')}
        `);
    } else {
        // Print the error message
        console.error(data.error.message);
    }
});

// You can also use async/await

⚙️ API

You can get your token here

You can find the full documentation here

⚖️ License

This project is licensed under the MIT License.

About

The best TypeScript wrapper for Vprikol API you can find

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published