Introduction
This JavaScript library provides an ability to get VortexOS userdata in frontend sites. People are able to modify data with inspect element, so this should be used for display reasons only. You are unable to fetch the userdata of a suspended user.
Installation
Include directly in your HTML file:
<script src="https://vortexos.onrender.com/auth.js"></script>
Usage
To set your site name:
VTX.name = "Test Site";
To make the "Login with VortexOS" button:
<button id="VTX_Login"></button>
When the user logs in, the "VTX_getUser" event is called:
document.addEventListener('VTX_getUser', (event) => {
//Your code here
});
API Reference
Here is a list of the userdata you can fetch:
VTX.user.id // Unique identifier for the user
VTX.user.username // Username of the user
VTX.user.permission // Permission level of the user
VTX.user.rank // User's rank
VTX.user.muted // Muted status of the user
VTX.user.color // Color associated with the user's rank
VTX.user.banner // User's banner video
VTX.user.avatar // User's avatar image
VTX.user.avatar_effect // Effect applied to the user's avatar
VTX.user.followers // Number of followers the user has
VTX.user.badges // Badges awarded to the user
VTX.user.credits // In-app credits of the user
VTX.user.xp // Experience points of the user
VTX.user.maxXP // Maximum experience points achievable by the user
VTX.user.level // Current level of the user
VTX.user.created // Date the account was created
Demo
You can view an interactive demo here.