function start() {
  // Create main workspace.
  workspace = Blockly.inject('blocklyDiv', {
    toolbox: toolbox,
  });

  workspace.addChangeListener((event) => {
    const code = javascript.javascriptGenerator.workspaceToCode(workspace);
    document.getElementById('generatedCodeContainer').value = code;
  });
}
Initialize a Blockly workspace, and add a change listener to update the display of generated code.

Called from index.html when the page initially loads.