Skip to main content
You can customize the Webchat widget by adding plugins. Find Webchat plugins in the plugin collection on GitHub or create your own custom plugins. You can implement plugins in:
  • Demo Webchat: test plugins from the collection using the endpoint settings.
  • Your code: add custom plugins or plugins from the collection to the Webchat widget on your website.
After you set them up, trigger them in the flow editor.

Test plugins in Demo Webchat

To test a plugin from the plugin collection, follow these steps:
  1. Open the Cognigy GitHub repository and select the plugin you want to use.
  2. On the Releases page, copy the URL of the JavaScript file from the Assets section of the plugin you selected. For example, the URL for the Google Firebase Authentication Webchat Plugin is https://github.com/Cognigy/WebchatPlugins/releases/download/google-firebase-authentication100/google-firebase-authentication.webchat-plugin.js.
  3. In Cognigy, open your project.
  4. In the navigation menu, go to Deploy > Endpoints.
  5. Select a Webchat v3 endpoint or create one by clicking + New endpoint.
  6. Go to the Layout tab and open the Demo Webchat settings section.
  7. In the Webchat plugins section, click Add plugin URL and paste the URL.
  8. Click Save.

Set up plugins in your code

You can set up plugins in the embedding code of your Webchat v3. To add plugins in your code, follow these steps:
  1. Open the Cognigy GitHub repository and select the plugin you want to use.
  2. On the Releases page, copy the URL of the JavaScript file from the Assets section of the plugin you selected. For example, the URL for the Google Firebase Authentication Webchat Plugin is https://github.com/Cognigy/WebchatPlugins/releases/download/google-firebase-authentication100/google-firebase-authentication.webchat-plugin.js.
  3. Add the plugin using a <script> tag after loading webchat.js and before calling initWebchat() in your HTML code, for example:

Trigger plugins

Most plugins based on Cognigy plugin examples are activated only when specific data is present in a message. The plugin code specifies the "match": "plugin-name" condition, which determines when the plugin is triggered. For example, the "match": "dialog" condition triggers the plugin when the message contains the word dialog. See the source code. For instance, consider a plugin that displays images in a chat interface, extracting the URL from the message’s data. This plugin has two parameters: match set to inline-image, and url, which retrieves the image URL from message.data._plugin.url. When Webchat receives a message, it triggers the inline-image plugin if the condition message.data._plugin.type === 'inline-image' is met. Then, the plugin retrieves the image URL from message.data._plugin.url. You can trigger plugins using the following components:

Basic nodes

  1. In the Say node editor, expand the Options section.
  2. In the Data field, enter the following JSON to trigger the plugin.
Example:

Code node

If you prefer using a Code node to send a message, you can pass the structured data payload as a second parameter to the api.output method. Example:

Extensions

You can build an extension that sends a message triggering the Webchat plugin, so you only need to include the necessary parameters. Custom module example:

More information

Last modified on November 11, 2026