Visibility API

Every call must reference your Agent API Name, which you’ll find in Agent Studio → Setup.

Example Initialization

foldspace("when", "ready", () => {
  const agent = foldspace.agent({ /* …common setup… */ });
  // Now you can call any of the methods below:
  // agent.message(...).open().setViewType("WIDGET").hide()...
});

Open / Close the Agent

Open the agent prompt

foldspace.agent("myproduct-agentic-agent").open();

Close the agent prompt

foldspace.agent("myproduct-agentic-agent").close();

Remove / Destroy

Tear down the agent completely—unmounts the UI, clears its state, and frees resources.

agent("myproduct-agentic-agent").remove();

Visibility Controls

Shows the agent widget

foldspace.agent("myproduct-agentic-agent").show();

Hide the agent widget

foldspace.agent("myproduct-agentic-agent").hide();