npm.io
2.0.1 • Published 8 months ago

snoway-api

Licence
ISC
Version
2.0.1
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
2

Snoway API Wrapper

npm version npm size license

Snoway API is a simple and lightweight Node.js wrapper that allows you to easily access Snoway's database to find a Discord user's old usernames and display names.

Installing

You can install this package using your favorite package manager:

# npm
npm i snoway-api

# Yarn
yarn add snoway-api

# Bun
bun i snoway-api

Example Usage

Here is a complete example of how to use the wrapper.

const SnowayAPI = require('snoway-api');
const api = new SnowayAPI("Your API key");

async function main() {
    const userId = 'USER_ID_HERE';
    try {
        // 1. Get all previous names (Global history)
        const allHistory = await api.allPrevnames(userId);
        console.log('All History:', allHistory);

        // 2. Get specific usernames history
        const names = await api.getNames(userId);
        console.log('Usernames:', names);

        // 3. Get specific display names history
        const displayNames = await api.getDisplay(userId);
        console.log('Display Names:', displayNames);

        // 4. Get API Stats
        const stats = await api.stats();
        console.log('API Stats:', stats);

    } catch (error) {
        console.error('An error occurred:', error);
    }
}

main();

Contributors

Keywords