Login

.login() is used to log into the session with an account

.login(username: string, password: string) : Promise<string>

Log into an account and get a session ID returned

Parameter

Type

Required

Description

username

string

true

The username of the account you want to access

password

string

true

The password of the account you want to access

Example

// Dependencies
const { Session }= require('cubed-session');
const session = new Session();

// 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);
circle-info

You do not have to manually store the session ID. This gets done automaticly.

Last updated