function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Laney Stroup 3Laney Stroup 3 

Initialize Live Agent with custom javascript events

Hi there! I need a way to initialize the Live Agent button manually for custom javascript events (rather than just on DOM ready). Is there any documentation on this or does anyone have any experience with this?

Thanks,
Laney
Mario PariseMario Parise
I haven't used it, but it appears to be well documented here:

https://developer.salesforce.com/docs/atlas.en-us.live_agent_dev.meta/live_agent_dev/live_agent_dev_guide_intro.htm

Specifically, I think you're going to want to look at the liveagent.init() method.
Laney Stroup 3Laney Stroup 3
Thanks, Mario. At the moment, I don't even see the liveagent variable in the javascript global namespace (even though the button and chat window are working fine). Do you (or anyone) know if anything has changed with the default implementation and/or their API? I just worked through the tutorials below: 

- https://trailhead.salesforce.com/en/projects/build-a-community-with-knowledge-and-chat/steps/enable-live-agent-and-communities
- https://trailhead.salesforce.com/en/projects/build-a-community-with-knowledge-and-chat/steps/create-a-chat-snap-in