SDK APIs
The SDK exposes a small set of methods on an agent instance. Call them once the SDK is ready:
foldspace("when", "ready", () => { const agent = foldspace.agent({ /* setup */ }); // call any SDK API below});The APIs
Section titled “The APIs”- Messaging — send chat messages as if the user typed them.
- Conversation — read and control the current conversation.
- Agent Event — subscribe to agent lifecycle and interaction events.
- Visibility — open, close, and show or hide the agent.
- Fuzzy search — fuzzy-match user phrasing to a record in a local list.
- Custom events — send your own product events with
foldspace.track(). - Test mode — run the agent in test mode without polluting real analytics.
Where to start
Section titled “Where to start”New to the SDK? Set up the agent first, then Messaging is the simplest call to try. To react to what the agent does, use Agent Event.