1.0.0 • Published 2 years ago

zenithapi v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Installation:

npm i zenithmmo

Authenticating:

const zenith = require('zenithmmo');

let user = new zenith.Client('Username', 'Password');

user.login(() => {
    console.log('Logged In')
}, ( err ) => {
    console.log('An error occured: \n'+err)
})

If you entered your username and password correctly you should get a message saying "Logged In" in your console

Accessing Data:

You have to wait until you are logged in before you can access any data as it doesn't have the token.

user.login(() => {
    console.log('Logged In')

    user.account.get(( data ) => {
        console.log(data)
    }, ( err ) => {
        console.error(err);
    })
})

There are 3 different types of data you can access at the moment

  • Account Data: user.account.get
  • Friend Data: user.friends.get
  • Character Data: user.characters.get

You can see an example in test/example.js

  • Hope this package helps you, Phaze :)