Messaging API

You can send messages to it as if the user typed them, enabling seamless product flows that blend conversation, actions, and UI components.

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

Example Initialization

foldspace("when", "ready", () => {
  const agent = foldspace.agent({ /* …common setup… */ });
  // Now you can call any of the methods below:
  agent.message("What actions can you do?");
});

message(text: string): this

Programmatically send a chat message as if the user typed it into the agent.

foldspace.agent("myproduct-agentic-agent")
  .message("Configure brand settings for me");

Send Dynamic Message

const userName = "John";
agent("myproduct-agentic-agent")
  .message(`Hi $USERNAME, let’s review your pipeline today`)
  .open();