Quick Start

Importing the packages

First you need to import the packages needed. There are 2 packages: dash and dashAuth. dashAuth. DashAuth is build upon xboxlive-auth and all credit for authenticating goes to them.

Since dash is built using javascript, this quick start will also use javascript.

const { dash } = require('@pyrondev/dash');
const { comboAuthenticate} = require('@pyrondev/dash-auth');

Authenticating

Dash is authenticated using a email and password. You will need to authenticate dash before you can continue.

Make sure to have your microsoft account email and password combo on hand.

const { dash } = require('@pyrondev/dash');
const { comboAuthenticate } = require('@pyrondev/dash-auth');

(async () => {
	const DashAuth = await comboAuthenticate("EMAIL", "PASSWORD");
	var Dash = new dash(dashAuth);
})();

In this demo we have replaced the email and password of your microsoft account with their respective names, your real email and password should not be shared with anyone and should look along the lines of

something@something.something
whatever

Using a microsoft code to authenticate

const { dash } = require('@pyrondev/dash');
const { msaCodeAuthenticate } = require('@pyrondev/dash-auth');

(async () => {
	const DashAuth = await msaCodeAuthenticate('', './profiles', {
		flow: "msal",
		relyingParty: 'https://pocket.realms.minecraft.net/'
	});
	var Dash = new dash(dashAuth);
})();

./profiles is a folder for account cache. To see more about how this is used go here

Realm

To use the realm methods you can initialise a realm class with a realm id or realm invite code.

const { dash } = require('@pyrondev/dash');
const { comboAuthenticate } = require('@pyrondev/dash-auth');

(async () => {
	const DashAuth = await comboAuthenticate("EMAIL", "PASSWORD");
	var Dash = new dash(dashAuth);
	var Realm = await Dash.realm(12345678);
})();

Or by using an invite code:

const { dash } = require('@pyrondev/dash');
const { comboAuthenticate } = require('@pyrondev/dash-auth');

(async () => {
	const DashAuth = await comboAuthenticate("EMAIL", "PASSWORD");
	var Dash = new dash(dashAuth);
	var Realm = await Dash.realmFromInvite("LTzLhdSCdE");
})();

Note that all of these examples are using fake realm information, you will need to use your own informaton.

Client

To use the client methods you can initialise a client class, no paramaters are needed.

const { dash } = require('@pyrondev/dash');
const { comboAuthenticate } = require('@pyrondev/dash-auth');

(async () => {
	const DashAuth = await comboAuthenticate("EMAIL", "PASSWORD");
	var Dash = new dash(dashAuth);
	var Client = await Dash.client();
})();

For all methods in either the realm or client class, refer to the documentation.

Last updated