Embedding the chat widget (script tag)
Embedding the chat widget (script tag)
Embedding the chat widget (script tag)
The simplest way to add the Runtype chat widget to your website is with a script tag. This works on any HTML page without framework dependencies.
The snippet includes a CDN-hosted script and an initialization call configured with your Client Token, theme, and API URL. Paste it before the closing </body> tag on any page where you want the chat widget.
</body>.The generated embed code calls initAgentWidget() from the @runtypelabs/persona package with your configuration. The Ship tab lets you customize:
Changes you make in the Ship tab are reflected in the generated embed code.
Chat widgets use Client Tokens for authentication instead of API keys. Client Tokens are:
Client Tokens use the ct_live_ or ct_test_ prefix. Create and manage them in the Auth tab of your chat Surface.
Configure which domains can use your chat widget by setting Allowed Origins in the Auth tab. The widget only works on approved domains.
For React applications, copy the embed code from the React tab in the Ship tab instead. See Embedding the chat widget (React).
Widget not appearing:
</body>Widget appears but does not respond: