Skip to main content
To embed the webchat in a guest-facing web app (e.g. a PWA or a web view embedded in an app), there are two paths: the Webchat SDK and loading the webchat URL directly in an iframe. Use the SDK when you need the full widget behavior and programmatic control. Use the direct URL when you want to drop the chat into any web view or iframe as simply as possible.

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.

Option 1: 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 a UMD and ES2015 bundle.

Installation

Initialization

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

If the app screen should show only the chat (without a floating button), set renderButton: false and isChatboxVisible: true.

Controlling at runtime

Option 2: Direct URL in an iframe

The webchat is available as a standalone application at https://webchat.dialogshift.com and can be loaded into any iframe or web view. Control happens exclusively through URL parameters.

Example

The webchat is responsive and fills the container you place the iframe in.

URL parameters

Any additional URL parameter not listed above is automatically merged into the visitor context. ?email=guest@example.com&name=John is therefore equivalent to a matching context JSON.

Which option?

  • SDK: Full widget behavior (button, teaser, unread counter) and programmatic control through methods and events.
  • Direct URL: Simplest integration without a JavaScript setup; ideal to render the chat as a full view or inside an iframe.