Engine

The Engine serves as the entry point for the SDK, providing access to all its functionalities. It's a singleton instance, ensuring that there can only be one instance of the engine available at any given time.

Initialization

1. Obtain a License

To use the Rendley SDK, you need to acquire a license. Visit Rendley (opens in a new tab) to obtain your license details.

import { Engine } from "@rendley/sdk";
 
const engine = Engine.getInstance({
  license: {
    licenseName: "YOUR_LICENSE_NAME",
    licenseKey: "YOUR_LICENSE_KEY",
  },
  display: {
    width: 1920,
    height: 1080,
    backgroundColor: "#000000",
  },
});

Replace YOUR_LICENSE_NAME and YOUR_LICENSE_KEY with your actual license.

This code sets up the singleton instance with your desired settings.

Once the singleton is initialized, you can use the engine to instantiate its functionalities. To do this, call the init method and pass in the canvas element where Rendley SDK will render its content:

await engine.init(canvasElement);

Note that the canvasElement should be an existing DOM element that you want to render the SDK's content into.