@aimdoc/sdk
v2.0.3
Published
Aimdoc SDK — typed helpers for identify, openChat, and sendMessage
Readme
Aimdoc SDK
Typed helpers for interacting with an embedded Aimdoc agent.
Next Message Context
Use setNextMessageContext to provide host application context for the next message sent to the in-app agent:
import { aimdoc } from '@aimdoc/sdk';
aimdoc.setNextMessageContext({
accountId: 'acct_123',
plan: 'enterprise',
currentWorkflow: 'Invite teammates',
});The context is added to the agent's system prompt for one turn only. It is not stored as a visible chat message, and it is cleared after the next message payload is sent.
If a page hosts multiple agents, pass agentId to target one widget:
aimdoc.setNextMessageContext(
{ currentWorkflow: 'Invite teammates' },
{ agentId: 'agent_123' }
);