npm i app-xbox-live
- getting account token: First, have your account token, if you don't have a token, try it to get your token:
const axl = require("app-xbox-live");
const token = await axl.Token("<your email>", "<your password>");
//output: ["token", "uhs"]
Note: For 2-step accounts, authorization from the owner is required.
Security: never display your token to anyone.
- setup token:
const xl = new axl.Account(`XBL3.0 x=${token};${uhs});
- logging with credentials:
const xl = await axl.Login("<email>", "<password>");
const xl = new axl.Account(`XBL3.0 x=${token[1]};${token[0]}`);
Or if you want to login directly, see below:
const xl = await axl.Login("<email>", "<password>");
this done, if there is no error, you can now manipulate data.
const opts = {
url: "<request url>",
method: "<method>",
...
}
xl.request(opts).then(data =>{
console.log(data);
});
It is not necessary to add the authorization header because the method automatically adds it.
const amount = 15;
xl.people.find("<gamertag>", amount).then(console.log);
xl.people.get("<xuid>").then(console.log);
xl.people.profile.get("<xuid>").then(console.log);
// OR
xl.people.profile.get(["<xuids>"]).then(console.log);
xl.people.recommendation.get().then(console.log);
xl.people.setting.get("<xuid>").then(console.log);
xl.people.summary.get("<xuid>").then(console.log);
xl.people.achievement.all.get("<xuid>").then(console.log);
xl.people.achievement.get("<xuid>", titleId, amount).then(console.log);
xl.people.achievement.stats.get("<xuid>", titleId).then(console.log);
// OR
xl.people.achievement.stats.get(["<xuids>"], titleId).then(console.log);
xl.people.achievement.titles.get("<xuid>").then(console.log);
xl.people.achievement.titles.complete.get("<xuid>").then(console.log);
xl.people.achievement.titles.get("<xuid>").then(user =>{
console.log(user);
});
const amount = 100;
xl.people.activity.get("<xuid>", amount).then(console.log);
const amount = 100;
xl.people.screenshot.get("<xuid>", amount).then(console.log);
xl.people.games.get("<xuid>").then(console.log);
xl.people.presence.get("<xuid>").then(console.log);
// OR
xl.people.presence.get(["<xuids>"]).then(console.log);
xl.people.add("<xuid>").then(() =>{
console.log("success");
});
// OR
xl.people.add(["<xuids>"]).then(() =>{
console.log("success");
});
xl.people.remove("<xuid>").then(() =>{
console.log("success");
});
// OR
xl.people.remove(["<xuids>"]).then(() =>{
console.log("success");
});
xl.people.gameclip.get("<xuid>", amount).then(console.log);
xl.people.clubs.get("<xuid>").then(console.log);
xl.people.friends.get("<xuid>").then(console.log);
xl.people.gameclip.get("<xuid>", amount).then(console.log);
xl.club.find("<club name>").then(console.log);
xl.club.get("<club id>").then(console.log);
const amount = 50;
xl.club.feed.get("<club id>", amount).then(console.log);
xl.club.feed.send("<club id>", "<message>").then(console.log);
const amount = 50;
xl.club.chat.get("<club id>", amount).then(console.log);
xl.chat.inbox.get().then(console.log);
xl.chat.auth.get("<xuid>").then(console.log);
const amount = 100;
xl.chat.message.get("<xuid>", amount).then(console.log);
xl.chat.message.send("<xuid>", "<message>").then(console.log);
xl.title.get("<id>").then(console.log);
// OR
xl.title.get(["<ids>"]).then(console.log);
xl.me.account.privacy.settings.get().then(console.log);
xl.me.profile.get().then(console.log);
xl.me.profile.friends.get().then(console.log);
xl.me.followers.get().then(console.log);
xl.me.profile.family.get("<xuid>").then(console.log);
xl.me.groups.get().then(console.log);
xl.me.reports.get().then(console.log);
xl.me.games.titlesId.get().then(console.log);