Load a composition with its token

Use this code to load a composition by its token for on-device use cases during the design process only.

For best performance and quickest loading times, we recommend using the composition URL when publishing an integration.

Supported data integrations


Control node


No support for REST API calls.

Data node


Update data nodes via the REST API.

Composition scripting


Manage user interactions and read data from third-party APIs.

Data stream


<!DOCTYPE html>

  <!-- Include the Singular Graphic JavaSrcipt library -->
  <script src="https://app.singular.live/libs/singulargraphics/1.0.0/singulargraphics.js"></script>

  <!-- define iFrame for a non-interactive Singular Player Instance -->
  <iframe id="SingularOverlay" style="width:720px; height: 400px;"

    // Composition token
    const COMPOSITION_TOKEN = "08EBsfeF4yoYLejOXM51Rk";

    // create graphic object from iframe 'SingularOverlay'
    const overlay = SingularGraphics("SingularOverlay");

    // render composition instance specified by COMPOSITION_TOKEN,
    // the second param is output name, passing undefined to select the first output
    overlay.loadComposition(COMPOSITION_TOKEN, null, function (isSuccess) {
      if (isSuccess) {
        console.log("Composition loaded");
      } else {
        console.warn("Couldn't load composition");

View on codepen.io.

Last updated