npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

xbl.io

v1.4.7

Published

An unofficial handler for accessing the xbl.io api.

Downloads

16

Readme

XBL.IO Unnofficial Client

BY: DerpDevs

Github Repo: github.com/TBHGodPro/xbl.io

What is this?

This is a project made by DerpDevs, we had been using xbl.io for a while and we wanted to make it easier for everyone to use it.

This works just like any API handler, but please note that we are not the official developers of xbl.io and that there may be issues with this.

Starting Off

To get started, head over to xbl.io and create an account, you can pick a free one but if you would like you may upgrade it (Note: Free accounts allow a maximum of 500 API requests per hour). Once you have created an account, go to your profile by clicking on your username, and clicking profile. Once you are there, make a new API Key and put it somewhere safe. At this point get your code editor open and run npm install xbl.io in the terminal to install the package (You need at least node 12 to use this package).

Note: For these examples, replace API_KEY and NEW_API_KEY with the actual api keys.

Instantiate Client


const XBL = require("xbl.io");
var client = new XBL.Client();



client.login(API_KEY, (account) => {
	console.log("Logged in as: " + account.settings.Gamertag + "!")
})

OR

await client.login(API_KEY)
console.log("Logged in as: " + account.settings.Gamertag + "!")

WARNING: client.login() is async (this is due to the fact that it must verify that the API Key is valid) so it may not be instant (though it is pretty quick) unless you run it with an await before it in an async function. Though you can run a callback with a parameter which is your account and another one which would be your oldAccount if you were logged in before.

You can easily login to another user by doing:

client.login(NEW_API_KEY, (newAccount, oldAccount) => {
	console.log("Logged out from: " + oldAccount.settings.Gamertag + " and logged in as: " + newAccount.settings.Gamertag + "!")
})



await client.login(NEW_API_KEY)
console.log("Logged in as: " + account.settings.Gamertag + "!")

Properties

cache

// Object
client.cache

The cache which stores all data recently fetched from the servers.

account

// Object
client.account

The most recent save of the client's account.

Cache

accounts

// Object<String:Object>
client.cache.accounts

The save of all accounts fetched (Saves non-repetitive objects with the user xuid as the key and the account object as the value).

Methods

logout

client.logout(optional:function:callback);

Logs out of the current account and calls callback with one parameter being the account that was logged out of.

getAccount

await client.getAccount(optional:String/Int/null:XUID);

Grabs the account of the XUID specified, if no XUID is specified, uses the currently logged in account's XUID.

getAccounts

await client.getAccounts(required:Array<String/Int/Null>:XUIDs);

Iterates throught the inputted Array and returns an array of the accounts of all the xuids inputted.

friends

await client.friends(optional:String/Int:XUID);

Grabs the accounts of all the friends of the account specified, if no account is specified, uses the currently logged in account.

userFetch

await client.userFetch(required:String:gamertag);

Grabs the account of the user specified.

friendAdd (Currently not working)

await client.friendAdd(required:String/Int:XUID);

Adds a friend to your friends list.

friendRemove (Currently not working)

await client.friendRemove(required:String/Int:XUID);

Removes a friend from your friends list.

favoriteAdd (Currently not working)

await client.favoriteAdd(required:String/Int:XUID);

Adds a friend to your favorites.

favoriteRemove (Currently not working)

await client.favoriteRemove(required:String/Int:XUID);

Removes a friend from your favorites while still keeping them in your friends list.

fetchPresence

await client.fetchPresence(optional:Array<String/Int>:XUIDs /* array */);

Fetches the presences of all the XUIDs in the array (they must be friends of yours) . If no array is inputted, it will fetch the presence of all your friends.

fetchConversation/fetchConversations

await client.fetchConversation(optional:String/Int:XUID);
OR
await client.fetchConversations(optional:String/Int:XUID);

Fetches the conversations between you and the user with the XUID. If no XUID is given, fetches all of your conversations.

sendMessage (UNTESTED)

await client.sendMessage(required:String:(user, u, or user/u) or (group, g, or group/g), required:String/Int:groupId or user XUID, required:String:message);

Sends a message to the user or group specified.

sendGroupMessage/sendUserMessage

Same arguments just without the first one. Does the same thing as sendMessage, just another method.

We hope this guide was helpful for you on your journey!