Skip to content

Latest commit

 

History

History
44 lines (33 loc) · 1.29 KB

README.md

File metadata and controls

44 lines (33 loc) · 1.29 KB

js-habbo-api-wrapper

A JavaScript wrapper for the undocumented Habbo API (inspired by https://github.com/gerbenjacobs/HabboAPI)

See tests/index.html file to examples of this library.

How to use it

  1. Download the src/HabboAPI.js
  2. Import it in your sketch
  3. Instantiate the HabboAPI class with your hotel (tested with com and com.br)
  4. Call one of the following methods:
    • getHabbo(id, useUniqueId = false)
    • getProfile(id)
    • getPhotos(id)
    • getGroup(id)
    • getAchievements(id)

All of these use Promises, in other words, are async and you need to attach an then(func) to the calls and this func will receive the data as parameter.

Usage

let api = new HabboAPI("com.br");
api.getHabbo("alynva")
    .then(user => {
        // Use `user` object here
        
        api.getProfile(user.id)
            .then(profile => {
                // Use `profile` object here
                
                api.getGroup(profile.groups[0].id)
                    .then(group => {
                        // Use `group` objecthere
                    });
            });
        
        // etc...
    });

Objects

An objects list will be available in the repo's wiki.