npm package: @runllm/search-widget
Description: This is the codebase for the search widget, which provides a modal for users to converse with an assistant.
Latest version: 0.0.42

# UI Search Widget

This is the codebase for the search widget, which provides a modal for users to
converse with an assistant.

The Search modal can be opened via hotkey or by clicking on the floating UI.

# Installation and Configuration

For a detailed example of how to set up the Widget, you can refer to the contents of `search-widget/index.html`.

# Development Quickstart

To get started developing the search widget, you will first need to install the dependencies:

# Prerequisites

In order to make authenticated requests to the search widget while in local development mode, you will need to configure reCAPTCHA according to the [reCAPTCHA configuration guide](https://www.notion.so/runllm/ReCaptcha-configuration-Guide-dd9204d10c0c4c479024193d2e5a4dc5?pvs=4).

# Installing Dependencies

This guide assumes that all commands are run from the root of the search-widget folder.

```
cd RunLLM/src/search-widget
```

To install the dependencies, run:

```bash
yarn install
```

# Building the bundle

You can build the widget's bundle by running:

```bash
yarn build
```

# Configuring your Development Site

You will need to configure your widget in the `src/search-widget/index.html` file according to the steps provided in the [Installation and Configuration](#installation-and-configuration) section.

Once you have your configuration set up accordingly, you can serve the widget by running:

```bash
npx serve
```

The `npx serve` command will serve the index.html file located at the root of the search-widget directory.

Note: Running `npx serve` creates an HTTP server. If you wish to serve an HTML file other than `index.html`, this will require some additional configuration. Please refer to the [documentation on npm for the serve package](https://www.npmjs.com/package/serve) for more details.

# Publishing Changes

After you are happy with your changes, you will need to publish a new verision of the npm package.

From the root of the `search-widget` directory, run the following command:

```
yarn publish
```

This command will prompt you for the new package version number. You can either provide a new number here, or press enter to omit.
If you provide the new version number, this command will update package.json and commit the change.

Running yarn publish requires that you are a part of the [runllm npm organization](https://www.npmjs.com/package/@runllm). Please contact @agiron123 for help with this if you are not currently a member.

After your changes are published, you can check [here](https://www.npmjs.com/package/@runllm/search-widget?activeTab=readme) to ensure that your newly published version is present.

# Deploying to Production

After testing your changes and verifying that everything is working properly, you can deploy the changes to production by tagging the version as stable.

To do so, you will need to tag the npm package version as 'stable'. You can achieve this by running the following command:

```sh
yarn tag add @runllm/search-widget@<version_number> stable
```

For more information on the yarn tag command, you can refer to the [documentation](https://classic.yarnpkg.com/lang/en/docs/cli/tag/).