highrise-js-sdk

highrise-logo

The Highrise JS SDK is a JavaScript library for writing and running Highrise bots.

[IMPORTANT]: Starting from version 2.0.0, we have made changes to the event handling in the highrise-js-sdk.
This provides you with greater flexibility and control over the types of events you receive when connecting to the SDK.

⚙️ Installation

npm i highrise-js-sdk@latest

✨ Features

📥 Class Import

const { Highrise } = require("highrise-js-sdk")

const settings = {
  token: 'EXAMPLE-TOKEN',
  room: 'EXAMPLE-ROOM',
  events: ['ready', 'playerJoin', 'playerLeave', 'messages'],
  reconnect: 5
}

const client = new Highrise({ events: settings.events }, settings.reconnect);
client.login(settings.token, settings.room);

📘 Documentation

Highrise JS SDK Documentation

Event Handling in highrise-js-sdk

By default, the ‘ready’ event is included, ensuring that you receive notifications when the bot is ready and connected to the Highrise server. However, for other events, you need to explicitly include them during the class import.

To include additional events, follow these steps:

  1. Import the Highrise class from the highrise-js-sdk package.
  2. Specify the events you want to receive by passing them as an array to the events parameter during the class import.
  3. Ensure that you import the necessary event handlers or listeners to handle the specific events of interest.

For example:

const { Highrise } = require("highrise-js-sdk");

// Specify the events you want to receive
const eventsOfInterest = ['ready', 'playerJoin', 'playerLeave', 'messages', 'emoteCreate'];

// Create an instance of the Highrise class with the specified events
const bot = new Highrise({ events: eventsOfInterest });

// Continue with the rest of your code and configurations

By including the desired events during the class import, you ensure that the corresponding event handlers are set up and triggered when those specific events occur within the Highrise environment. To learn more about the available events and their descriptions, you can refer to the Highrise-js SDK Documentation. With the updated event handling mechanism, you have greater control over the types of events you receive, allowing you to tailor the behavior and functionality of your bot according to your specific requirements.

🎐 Events

Note

This package is not an official Highrise package, it’s self-made by iHsein (sphinix) and is still in beta.