# Plugin Migration

As of June 2022 the method of installing the chat plugin is changing. This change requires a short configuration update however by moving towards this new approach it allows us to more quickly provide new features and improvements to all of our customers.&#x20;

Please note, the old approach is being **sunset on 1st July 2022** and so this page outlines the difference between the two approaches and how to migrate between them.&#x20;

### Old Method

In previous versions customers would have been provided with unique URLs for both the JavaScript and the CSS needed for the application. For example, the following `<script>` tag might have been used.

```html
<script 
    type="text/javascript" 
    src="https://monmouth-county-council-wbb-chat-plugin.webuildbots.ai/wbb-chat-plugin.js">
</script>
```

In this example, the URL for the resources contains `monmouth-county-council`. Using this bespoke URL meant that you had to provide very little other settings, and specifically you did not have to specify a `client` parameter, which is explained in more detail below.&#x20;

### New Approach

The new approach makes it much easier for us to deploy and maintain new fixes, yet still makes it simple to add the plugin to a webpage.&#x20;

To migrate to the new approach there is generally two changes that you'll need to make.&#x20;

* [ ] Swap over the URL to use the generic URL
* [ ] Add a `client` parameter to the configuration used.&#x20;

These are explained in more detail below.&#x20;

#### New URL

To make this change, simply replace any instances of the bespoke URL, with the new URL for the plugin which is `https://wbb-chat-plugin.intelagent.ai`. For example, if you are referencing the JavaScript file directly as in the example above, then the equivalent for this line of code would be :&#x20;

```html
<script 
    type="text/javascript" 
    src="https://wbb-chat-plugin.logicdialog.ai/wbb-chat-plugin.js">
</script>
```

You will also need to ensure that the `pluginHost` parameter as shown below is also updated.&#x20;

```html
<script>
  new WBBChatPlugin({
    pluginHost: 'https://wbb-chat-plugin.logicdialog.ai',
    minPopupWidth: 600,
    promptDelay: 2000,
    primaryColour: '019C8C',
    secondaryColour: '435061',
    language: 'en',
    clientIcon: true,
    typingIndicator: true
  });
</script>
```

#### Client Parameter

Once you have made the change to the URL then you now also need to provide additional information to the configuration so that it knows which application to use. This is again a simple change and only requires you to add a `client` parameter to the object that you pass to the `WBBChatPlugin` class. For example, to modify the example above it would look something like this :&#x20;

```html
<script>
  new WBBChatPlugin({
    pluginHost: 'https://wbb-chat-plugin.logicdialog.ai',
    client: 'monmouth-county-council',
    minPopupWidth: 600,
    promptDelay: 2000,
    primaryColour: '019C8C',
    secondaryColour: '435061',
    language: 'en',
    clientIcon: true,
    typingIndicator: true
  });
</script>
```

In this example, we've added **line 4** into the configuration. The value for the `client` parameter needs to be the first part of the previous URL used. For example, if your URL was previously `https://monmouth-county-council-wbb-chat-plugin.webuildbots.ai` then the value of the `client` parameter needs to be `monmouth-county-council` as it is the part of the url before the `-wbb-chat-plugin`.

Once you have made these two changes, the plugin should look and work exactly the same as it did previously.&#x20;

Please refer to the installation instructions for more details.&#x20;

{% content-ref url="../setup/installation" %}
[installation](https://chat-plugin.logicdialog.ai/setup/installation)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://chat-plugin.logicdialog.ai/migration/plugin-migration.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
