v0.10.0
The pre-chat form is set in the CloudTrain dashboard, not in the embed.
Breaking: preChatFields and requirePreChat (require-pre-chat) are removed from the web component, the React wrapper and the React Native widget. An embed now needs only its key.
- Whether the form shows is the widget's own setting: Ask for details before the chat (Settings → Widgets), sent as
pre_chatbyGET /api/v1/agent. - What it asks is the agent's lead fields (Settings → Lead fields), sent as
lead_fields. Each submission becomes a lead in the dashboard, so an embed can no longer ask for fields that would never be saved. - An email or a phone number is always required, since a lead is only saved with one.
leadCaptured(web) andonLeadCaptured(React Native) stay, for the page's or app's own tracking - a conversion, a pixel. The lead itself is saved by CloudTrain with the first message.- SDK:
Agentgainslead_fieldsandpre_chat(both optional, for older servers), andlacksContact()/LeadFieldare exported.
Upgrading: remove preChatFields and requirePreChat from your embed and turn the setting on for the widget instead.