Embedded Mode
Prerequisite
Make sure you have already installed the SDK.
Initializing the Agent
Use the following snippet to initialize the embedded agent inside your application.
// Replace with the API name from Agent Studio → Setup
const AGENT_API_NAME = "Foo";
const agentContainer = document.getElementById('agentContainer');
foldspace('when', 'ready', () => {
foldspace.agent({
apiName: AGENT_API_NAME,
mode: 'EMBEDDED',
configuration: {
embeddedConfiguration: {
container: agentContainer
}
}
});
});
Embedded Configuration (Partial Reference)
The embeddedConfiguration object controls how the agent is rendered inside your application. Below are the three properties relevant for initialization on this page:
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
| container | HTMLElement | Yes | - | The DOM element where the embedded agent will be mounted. Must be an existing element reference. |
For all other appearance, layout, and behavioral options, visit the full configuration reference.
It is highly recommended to use the Agent Studio > Style & Behavior to configure the agent look & feel
Updated 25 days ago