Prerequisites
- The Client ID of your app. You find it in the DialogShift dashboard. For development and testing you can use the demo Client ID
pro12bd. - The channel code of the source. For a guest app it must be set to exactly
pwa-guestapp. The channel code lets us attribute conversations to the correct source.
The channel code cannot be chosen freely. For a guest app, set it to exactly
pwa-guestapp. Additional channel codes only in coordination with DialogShift Support.Integration via SDK
The SDK renders the toggle button and the chat window, loads the chat inside an iframe, and exposes methods to control it. It is available as aUMD and ES2015 bundle.
1
Install the SDK
2
Initialize the chat
Set your Client ID as
id and the channel code through context.channel. The example uses the demo Client ID pro12bd.Dialogshift.instance() returns a singleton: calling it again without arguments returns the same instance.Key options
Full-screen integration: chat only
The most common case in a guest app: the screen should show only the chat, without a floating button. To do this, skip rendering the button and open the chat window immediately.initialElement the specified element is triggered automatically on open - the guest immediately sees a welcome message.
Lifecycle: init and ready
The SDK fires two central events:
initfires once the widgets are rendered and the configuration is loaded. From now on you can call API methods, but you cannot trigger messages yet.readyfires once the chat is connected to the messaging channel. The connection is only established when the chat window is opened for the first time - if it stays closed,readynever fires.

