Skip to content

Commit

Permalink
docs: fix description loss for using js widgets (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
sykp241095 authored Feb 24, 2025
1 parent 33c26dc commit a769bd2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ TIDB_SSL=true
#
# Notice: this variable will be deprecated in the future.
EMBEDDING_MAX_TOKENS=2048

# JS Widgets: if you want to use JS widgets, you need to set the following variables to enable CORS.
# BACKEND_CORS_ORIGINS=['http://localhost:3000', 'https://your-domain.com']
13 changes: 13 additions & 0 deletions frontend/app/src/pages/docs/javascript.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

What if you could integrate a conversational search window into your website to facilitate instant responses to product-related queries? With the embeddable JavaScript snippet, you can do just that. This feature allows you to copy and embed a simple JavaScript code snippet into your website, typically placed at the bottom right corner of your site.

## Pre-requisites

If you want to embed the JavaScript snippet into your other website, you need to enable it in `.env` file.

* Step 1: Enable the JavaScript Widget

```bash
# JS Widgets: if you want to use JS widgets, you need to set the following variables to enable CORS.
BACKEND_CORS_ORIGINS=['http://localhost:3000', 'https://your-domain.com']
```

* Step 2: Restart your service

## How to Embed

To embed the JavaScript snippet, follow these steps:
Expand Down

0 comments on commit a769bd2

Please sign in to comment.