Logging Into An Account

This tutorial will talk you through logging into an account.

First we need to require Cubed-API. To do this add the following code at the top of your JavaScript file:

// Dependencies
const CubedCraft = require('cubed-api');

Now you can login to the account with the following code:

// Dependencies
const CubedCraft = require('cubed-api');

// Account Details
const username = 'ACCOUNT_USERNAME';
const password = 'ACCOUNT_PASSWORD';

// Defining The Session ID Variable
var sessionID;

// Logging Into The Account
CubedCraft.login(username, password).then(ses => sessionID = ses);

The variable "sessionID" will now be set to a session ID for your account. This Session ID can now be used to perform actions.

Make sure you have read the guide on Session ID's so you understand what you are doing with a session ID: https://pondwadermc.gitbook.io/cubed-api/tutorials-and-guides/sessions

Last updated

Was this helpful?