2.8.12 • Published 1 month ago

@openchatai/copilot-widget v2.8.12

Weekly downloads
-
License
-
Repository
-
Last release
1 month ago

OpenCopilot widget

This is the widget for OpenCopilot: it's what your users will interact with.

It's a simple React application that can be used in any webpage as a widget. To download the latest build of the widget, go to the actions tab in GitHub and download the latest build artifact.

How to install

  1. Download the latest build artifact from the actions tab.

  2. Extract the zip file.

  3. Copy the assets/*.js file to your project.

  4. Reference the js file in your HTML file as follows:

    <script src="[some_js_file].js"></script>
  5. Initialize the widget.

    <script>
      // you should run it after window loads
      window.onload = () => {
        initAiCoPilot({
          initialMessage: "Hey, how can I help you today?", // initial bot message
          token: "not_super_secret_token", // your OpenCopilot token
          rootId: "copilot-widget", // @optional: the root element id in which the widget will mount on
          triggerSelector: "#triggerSelector", // the selector of the element that will trigger the widget on click
          apiUrl: "https://cloud.openchat.so/api", // the url of the OpenCopilot api.
          headers: {
            Authorization: "Bearer your_auth_token_goes_here",
          }, // @optional: headers that you want to send with every message request
          bot: {
             name: "AI Assistant",
             avatarUrl: "https://example.com/company-logo.png"
          }, // @optional: bot object – this info will be used in the chat
          user: {
             name: "John Doe",
             avatarUrl: "https://example.com/user-avatar.png"
          }, // @optional: user object – this info will be used in the chat
          containerProps: {}, // @optional: `HTMLProps`
          warnBeforeClose: true, // @optional: Set to false if you don't want to warn the user before closing the chat
          onClose: () => {
             console.log('Closing chat window.');
          } // @optional: Callback before closing the chat
        });
      };
    </script>

How to use

  1. Click on the trigger element to open the widget.

  2. Type your message and press enter to send it.

2.8.12

1 month ago

2.8.11

2 months ago

2.8.11-beta.0

2 months ago

2.8.10

2 months ago

2.8.9

2 months ago

2.8.8

2 months ago

2.8.7

2 months ago

2.8.1

2 months ago

2.8.3

2 months ago

2.8.2

2 months ago

2.8.5

2 months ago

2.8.4

2 months ago

2.8.6

2 months ago

2.8.0-beta.6

2 months ago

2.8.0-beta.4

2 months ago

2.8.0-beta.3

2 months ago

2.8.0

2 months ago

2.8.0-beta.2

2 months ago

2.8.0-beta.1

2 months ago

2.8.0-beta.0

2 months ago

2.7.0-beta.0

2 months ago

2.6.0

2 months ago

2.5.5

2 months ago

2.5.4

2 months ago

2.5.3

2 months ago

2.5.2

3 months ago

2.5.1

3 months ago

2.5.0

3 months ago

2.4.1

3 months ago

2.4.2

3 months ago

2.4.0

3 months ago

2.3.2

3 months ago

2.3.1

3 months ago

2.3.0

3 months ago

2.2.2

3 months ago

2.2.1

4 months ago

2.2.0

4 months ago

2.1.0

4 months ago

2.0.1

4 months ago

2.0.0

4 months ago

1.7.0

4 months ago

1.6.1

5 months ago

1.6.0

5 months ago

1.5.0

5 months ago

1.4.0

5 months ago

1.3.2

5 months ago

1.3.1

5 months ago

1.3.0

5 months ago

1.2.0

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.9

7 months ago

1.0.8

7 months ago

1.0.7

7 months ago

1.0.6

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

7 months ago

1.0.0

7 months ago