# sg-chatbot-ui

> Stencil Component Starter

Latest version **0.0.14** (published 2025-01-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install sg-chatbot-ui
pnpm add sg-chatbot-ui
yarn add sg-chatbot-ui
bun add sg-chatbot-ui
```

## Health

**Score 50/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 0.0.14 |
| Published | 2025-01-27 |
| First published | 2024-11-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 250 |
| Unpacked size | 4.8 MB |
| Known vulnerabilities | 0 (+11 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 289 |
| Author | sentientgeeks pvt ltd |
| Maintainers | abdul453 |
| Keywords | chatbot |

## Links

- npm: https://www.npmjs.com/package/sg-chatbot-ui
- Repository: https://github.com/ionic-team/stencil-component-starter
- Homepage: https://github.com/ionic-team/stencil-component-starter#readme
- Issues: https://github.com/ionic-team/stencil-component-starter/issues
- npm.io page: https://npm.io/package/sg-chatbot-ui

## Dependencies (250)

- [co](https://npm.io/package/co.md) ^4.6.0
- [ms](https://npm.io/package/ms.md) ^2.1.3
- [ws](https://npm.io/package/ws.md) ^8.16.0
- [b4a](https://npm.io/package/b4a.md) ^1.6.6
- [bser](https://npm.io/package/bser.md) ^2.1.1
- [exit](https://npm.io/package/exit.md) ^0.1.2
- [glob](https://npm.io/package/glob.md) ^7.2.3
- [jsbn](https://npm.io/package/jsbn.md) ^1.1.0
- [mitt](https://npm.io/package/mitt.md) ^3.0.1
- [once](https://npm.io/package/once.md) ^1.4.0
- [pend](https://npm.io/package/pend.md) ^1.2.0
- [pump](https://npm.io/package/pump.md) ^3.0.2
- [tmpl](https://npm.io/package/tmpl.md) ^1.0.5
- [tr46](https://npm.io/package/tr46.md) ^0.0.3
- [y18n](https://npm.io/package/y18n.md) ^5.0.8
- [chalk](https://npm.io/package/chalk.md) ^4.1.2
- [cliui](https://npm.io/package/cliui.md) ^8.0.1
- [debug](https://npm.io/package/debug.md) ^4.3.7
- [execa](https://npm.io/package/execa.md) ^5.1.1
- [isexe](https://npm.io/package/isexe.md) ^2.0.0
- [jsesc](https://npm.io/package/jsesc.md) ^2.5.2
- [json5](https://npm.io/package/json5.md) ^2.2.3
- [kleur](https://npm.io/package/kleur.md) ^3.0.3
- [leven](https://npm.io/package/leven.md) ^3.1.0
- [p-try](https://npm.io/package/p-try.md) ^2.2.0
- [slash](https://npm.io/package/slash.md) ^3.0.0
- [socks](https://npm.io/package/socks.md) ^2.8.3
- [tslib](https://npm.io/package/tslib.md) ^2.7.0
- [which](https://npm.io/package/which.md) ^2.0.2
- [yargs](https://npm.io/package/yargs.md) ^17.7.2
- [yauzl](https://npm.io/package/yauzl.md) ^2.10.0
- [braces](https://npm.io/package/braces.md) ^3.0.3
- [buffer](https://npm.io/package/buffer.md) ^5.7.1
- [dedent](https://npm.io/package/dedent.md) ^1.5.3
- [dotenv](https://npm.io/package/dotenv.md) ^16.4.5
- [expect](https://npm.io/package/expect.md) ^29.7.0
- [hasown](https://npm.io/package/hasown.md) ^2.0.2
- [semver](https://npm.io/package/semver.md) ^6.3.1
- [tar-fs](https://npm.io/package/tar-fs.md) ^3.0.4
- [walker](https://npm.io/package/walker.md) ^1.0.8
- [wrappy](https://npm.io/package/wrappy.md) ^1.0.2
- [ci-info](https://npm.io/package/ci-info.md) ^3.9.0
- [esprima](https://npm.io/package/esprima.md) ^4.0.1
- [esutils](https://npm.io/package/esutils.md) ^2.0.3
- [find-up](https://npm.io/package/find-up.md) ^4.1.0
- [gensync](https://npm.io/package/gensync.md) ^1.0.0-beta.2
- [get-uri](https://npm.io/package/get-uri.md) ^6.0.3
- [globals](https://npm.io/package/globals.md) ^11.12.0
- [ieee754](https://npm.io/package/ieee754.md) ^1.2.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.14.1
- [netmask](https://npm.io/package/netmask.md) ^2.0.2
- [onetime](https://npm.io/package/onetime.md) ^5.1.2
- [p-limit](https://npm.io/package/p-limit.md) ^3.1.0
- [pirates](https://npm.io/package/pirates.md) ^4.0.6
- [pkg-dir](https://npm.io/package/pkg-dir.md) ^4.2.0
- [prompts](https://npm.io/package/prompts.md) ^2.4.2
- [resolve](https://npm.io/package/resolve.md) ^1.22.8
- [streamx](https://npm.io/package/streamx.md) ^2.20.1
- [through](https://npm.io/package/through.md) ^2.3.8
- [yallist](https://npm.io/package/yallist.md) ^3.1.1
- [anymatch](https://npm.io/package/anymatch.md) ^3.1.3
- [argparse](https://npm.io/package/argparse.md) ^1.0.10
- [emittery](https://npm.io/package/emittery.md) ^0.13.1
- [error-ex](https://npm.io/package/error-ex.md) ^1.3.2
- [escalade](https://npm.io/package/escalade.md) ^3.2.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^11.2.0
- [has-flag](https://npm.io/package/has-flag.md) ^4.0.0
- [inflight](https://npm.io/package/inflight.md) ^1.0.6
- [inherits](https://npm.io/package/inherits.md) ^2.0.4
- [jsonfile](https://npm.io/package/jsonfile.md) ^6.1.0
- [make-dir](https://npm.io/package/make-dir.md) ^4.0.0
- [mimic-fn](https://npm.io/package/mimic-fn.md) ^2.1.0
- [p-locate](https://npm.io/package/p-locate.md) ^4.1.0
- [path-key](https://npm.io/package/path-key.md) ^3.1.1
- [progress](https://npm.io/package/progress.md) ^2.0.3
- [react-is](https://npm.io/package/react-is.md) ^18.3.1
- [ast-types](https://npm.io/package/ast-types.md) ^0.13.4
- [base64-js](https://npm.io/package/base64-js.md) ^1.5.1
- [basic-ftp](https://npm.io/package/basic-ftp.md) ^5.0.5
- [callsites](https://npm.io/package/callsites.md) ^3.1.0
- [camelcase](https://npm.io/package/camelcase.md) ^5.3.1
- [deepmerge](https://npm.io/package/deepmerge.md) ^4.3.1
- [env-paths](https://npm.io/package/env-paths.md) ^2.2.1
- [escodegen](https://npm.io/package/escodegen.md) ^2.1.0
- [fast-fifo](https://npm.io/package/fast-fifo.md) ^1.3.2
- [fd-slicer](https://npm.io/package/fd-slicer.md) ^1.1.0
- [is-number](https://npm.io/package/is-number.md) ^7.0.0
- [is-stream](https://npm.io/package/is-stream.md) ^2.0.1
- [jest-diff](https://npm.io/package/jest-diff.md) ^29.7.0
- [jest-each](https://npm.io/package/jest-each.md) ^29.7.0
- [jest-mock](https://npm.io/package/jest-mock.md) ^29.7.0
- [jest-util](https://npm.io/package/jest-util.md) ^29.7.0
- [js-tokens](https://npm.io/package/js-tokens.md) ^4.0.0
- [lru-cache](https://npm.io/package/lru-cache.md) ^5.1.1
- [makeerror](https://npm.io/package/makeerror.md) ^1.0.12
- [minimatch](https://npm.io/package/minimatch.md) ^3.1.2
- [picomatch](https://npm.io/package/picomatch.md) ^2.3.1
- [pure-rand](https://npm.io/package/pure-rand.md) ^6.1.0
- [strip-bom](https://npm.io/package/strip-bom.md) ^4.0.0
- [type-fest](https://npm.io/package/type-fest.md) ^0.21.3
- [wrap-ansi](https://npm.io/package/wrap-ansi.md) ^7.0.0
- [agent-base](https://npm.io/package/agent-base.md) ^7.1.1
- [ansi-regex](https://npm.io/package/ansi-regex.md) ^5.0.1
- [babel-jest](https://npm.io/package/babel-jest.md) ^29.7.0
- [char-regex](https://npm.io/package/char-regex.md) ^1.0.2
- [color-name](https://npm.io/package/color-name.md) ^1.1.4
- [concat-map](https://npm.io/package/concat-map.md) ^0.0.1
- [estraverse](https://npm.io/package/estraverse.md) ^5.3.0
- [fill-range](https://npm.io/package/fill-range.md) ^7.1.1
- [get-stream](https://npm.io/package/get-stream.md) ^6.0.1
- [ip-address](https://npm.io/package/ip-address.md) ^9.0.5
- [micromatch](https://npm.io/package/micromatch.md) ^4.0.8
- [node-fetch](https://npm.io/package/node-fetch.md) ^2.7.0
- [node-int64](https://npm.io/package/node-int64.md) ^0.4.0
- [parse-json](https://npm.io/package/parse-json.md) ^5.2.0
- [path-parse](https://npm.io/package/path-parse.md) ^1.0.7
- [picocolors](https://npm.io/package/picocolors.md) ^1.1.0
- [queue-tick](https://npm.io/package/queue-tick.md) ^1.0.1
- [sisteransi](https://npm.io/package/sisteransi.md) ^1.0.5
- [source-map](https://npm.io/package/source-map.md) ^0.6.1
- [sprintf-js](https://npm.io/package/sprintf-js.md) ^1.0.3
- [strip-ansi](https://npm.io/package/strip-ansi.md) ^6.0.1
- [tar-stream](https://npm.io/package/tar-stream.md) ^3.1.7
- [whatwg-url](https://npm.io/package/whatwg-url.md) ^5.0.0
- [ansi-styles](https://npm.io/package/ansi-styles.md) ^4.3.0
- [bare-events](https://npm.io/package/bare-events.md) ^2.4.2
- [buffer-from](https://npm.io/package/buffer-from.md) ^1.1.2
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^9.0.0
- [create-jest](https://npm.io/package/create-jest.md) ^29.7.0
- [cross-fetch](https://npm.io/package/cross-fetch.md) ^4.0.0
- [cross-spawn](https://npm.io/package/cross-spawn.md) ^7.0.3
- [degenerator](https://npm.io/package/degenerator.md) ^5.0.1
- [emoji-regex](https://npm.io/package/emoji-regex.md) ^8.0.0
- [extract-zip](https://npm.io/package/extract-zip.md) ^2.0.1
- [fb-watchman](https://npm.io/package/fb-watchman.md) ^2.0.2
- [fs.realpath](https://npm.io/package/fs.realpath.md) ^1.0.0
- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.2.11
- [imurmurhash](https://npm.io/package/imurmurhash.md) ^0.1.4
- [is-arrayish](https://npm.io/package/is-arrayish.md) ^0.2.1
- [jest-circus](https://npm.io/package/jest-circus.md) ^29.7.0
- [jest-config](https://npm.io/package/jest-config.md) ^29.7.0
- [jest-runner](https://npm.io/package/jest-runner.md) ^29.7.0
- [jest-worker](https://npm.io/package/jest-worker.md) ^29.7.0
- [locate-path](https://npm.io/package/locate-path.md) ^5.0.0
- [path-exists](https://npm.io/package/path-exists.md) ^4.0.0
- [proxy-agent](https://npm.io/package/proxy-agent.md) ^6.3.1
- [resolve-cwd](https://npm.io/package/resolve-cwd.md) ^3.0.0
- [signal-exit](https://npm.io/package/signal-exit.md) ^3.0.7
- [stack-utils](https://npm.io/package/stack-utils.md) ^2.0.6
- [type-detect](https://npm.io/package/type-detect.md) ^4.0.8
- [yocto-queue](https://npm.io/package/yocto-queue.md) ^0.1.0
- [ansi-escapes](https://npm.io/package/ansi-escapes.md) ^4.3.2
- [browserslist](https://npm.io/package/browserslist.md) ^4.23.3
- [buffer-crc32](https://npm.io/package/buffer-crc32.md) ^0.2.13
- [caniuse-lite](https://npm.io/package/caniuse-lite.md) ^1.0.30001662
- [html-escaper](https://npm.io/package/html-escaper.md) ^2.0.2
- [import-fresh](https://npm.io/package/import-fresh.md) ^3.3.0
- [import-local](https://npm.io/package/import-local.md) ^3.2.0
- [jest-resolve](https://npm.io/package/jest-resolve.md) ^29.7.0
- [jest-runtime](https://npm.io/package/jest-runtime.md) ^29.7.0
- [jest-watcher](https://npm.io/package/jest-watcher.md) ^29.7.0
- [merge-stream](https://npm.io/package/merge-stream.md) ^2.0.0
- [npm-run-path](https://npm.io/package/npm-run-path.md) ^4.0.1
- [pac-resolver](https://npm.io/package/pac-resolver.md) ^7.0.1
- [resolve-from](https://npm.io/package/resolve-from.md) ^5.0.0
- [smart-buffer](https://npm.io/package/smart-buffer.md) ^4.2.0
- [string-width](https://npm.io/package/string-width.md) ^4.2.3
- [test-exclude](https://npm.io/package/test-exclude.md) ^6.0.0
- [text-decoder](https://npm.io/package/text-decoder.md) ^1.2.0
- [universalify](https://npm.io/package/universalify.md) ^2.0.1
- [yargs-parser](https://npm.io/package/yargs-parser.md) ^21.1.1
- [chromium-bidi](https://npm.io/package/chromium-bidi.md) ^0.5.8
- [color-convert](https://npm.io/package/color-convert.md) ^2.0.1
- [end-of-stream](https://npm.io/package/end-of-stream.md) ^1.4.4
- [function-bind](https://npm.io/package/function-bind.md) ^1.1.2
- [human-signals](https://npm.io/package/human-signals.md) ^2.1.0
- [jest-docblock](https://npm.io/package/jest-docblock.md) ^29.7.0
- [jest-get-type](https://npm.io/package/jest-get-type.md) ^29.6.3
- [jest-snapshot](https://npm.io/package/jest-snapshot.md) ^29.7.0
- [jest-validate](https://npm.io/package/jest-validate.md) ^29.7.0
- [node-releases](https://npm.io/package/node-releases.md) ^2.0.18
- [parent-module](https://npm.io/package/parent-module.md) ^1.0.1
- [pretty-format](https://npm.io/package/pretty-format.md) ^29.7.0
- [shebang-regex](https://npm.io/package/shebang-regex.md) ^3.0.0
- [string-length](https://npm.io/package/string-length.md) ^4.0.2
- [balanced-match](https://npm.io/package/balanced-match.md) ^1.0.2
- [detect-newline](https://npm.io/package/detect-newline.md) ^3.1.0
- [diff-sequences](https://npm.io/package/diff-sequences.md) ^29.6.3
- [is-core-module](https://npm.io/package/is-core-module.md) ^2.15.1
- [jest-haste-map](https://npm.io/package/jest-haste-map.md) ^29.7.0
- [mkdirp-classic](https://npm.io/package/mkdirp-classic.md) ^0.5.3
- [normalize-path](https://npm.io/package/normalize-path.md) ^3.0.0
- [proxy-from-env](https://npm.io/package/proxy-from-env.md) ^1.1.0
- [puppeteer-core](https://npm.io/package/puppeteer-core.md) ^21.11.0
- [supports-color](https://npm.io/package/supports-color.md) ^7.2.0
- [to-regex-range](https://npm.io/package/to-regex-range.md) ^5.0.1
- [unbzip2-stream](https://npm.io/package/unbzip2-stream.md) ^1.4.3
- [v8-to-istanbul](https://npm.io/package/v8-to-istanbul.md) ^9.3.0
- [brace-expansion](https://npm.io/package/brace-expansion.md) ^1.1.11
- [get-caller-file](https://npm.io/package/get-caller-file.md) ^2.0.5
- [is-generator-fn](https://npm.io/package/is-generator-fn.md) ^2.1.0
- [jest-regex-util](https://npm.io/package/jest-regex-util.md) ^29.6.3
- [natural-compare](https://npm.io/package/natural-compare.md) ^1.4.0
- [pac-proxy-agent](https://npm.io/package/pac-proxy-agent.md) ^7.0.2
- [resolve.exports](https://npm.io/package/resolve.exports.md) ^2.0.2
- [shebang-command](https://npm.io/package/shebang-command.md) ^2.0.0
- [cjs-module-lexer](https://npm.io/package/cjs-module-lexer.md) ^1.4.1
- [get-package-type](https://npm.io/package/get-package-type.md) ^0.1.0
- [http-proxy-agent](https://npm.io/package/http-proxy-agent.md) ^7.0.2
- [istanbul-reports](https://npm.io/package/istanbul-reports.md) ^3.1.7
- [path-is-absolute](https://npm.io/package/path-is-absolute.md) ^1.0.1
- [socket.io-client](https://npm.io/package/socket.io-client.md) ^4.8.0
- [babel-preset-jest](https://npm.io/package/babel-preset-jest.md) ^29.6.3
- [devtools-protocol](https://npm.io/package/devtools-protocol.md) ^0.0.1232444
- [https-proxy-agent](https://npm.io/package/https-proxy-agent.md) ^7.0.5
- [jest-message-util](https://npm.io/package/jest-message-util.md) ^29.7.0
- [jest-pnp-resolver](https://npm.io/package/jest-pnp-resolver.md) ^1.2.3
- [lines-and-columns](https://npm.io/package/lines-and-columns.md) ^1.2.4
- [require-directory](https://npm.io/package/require-directory.md) ^2.1.1
- [socks-proxy-agent](https://npm.io/package/socks-proxy-agent.md) ^8.0.4
- [write-file-atomic](https://npm.io/package/write-file-atomic.md) ^4.0.2
- [convert-source-map](https://npm.io/package/convert-source-map.md) ^2.0.0
- [data-uri-to-buffer](https://npm.io/package/data-uri-to-buffer.md) ^6.0.2
- [jest-changed-files](https://npm.io/package/jest-changed-files.md) ^29.7.0
- [jest-leak-detector](https://npm.io/package/jest-leak-detector.md) ^29.7.0
- [jest-matcher-utils](https://npm.io/package/jest-matcher-utils.md) ^29.7.0
- [source-map-support](https://npm.io/package/source-map-support.md) ^0.5.13
- [to-fast-properties](https://npm.io/package/to-fast-properties.md) ^2.0.0
- [webidl-conversions](https://npm.io/package/webidl-conversions.md) ^3.0.1
- [collect-v8-coverage](https://npm.io/package/collect-v8-coverage.md) ^1.0.2
- [istanbul-lib-report](https://npm.io/package/istanbul-lib-report.md) ^3.0.1
- [strip-final-newline](https://npm.io/package/strip-final-newline.md) ^2.0.0
- [strip-json-comments](https://npm.io/package/strip-json-comments.md) ^3.1.1
- [urlpattern-polyfill](https://npm.io/package/urlpattern-polyfill.md) ^10.0.0
- [@rollup/plugin-image](https://npm.io/package/@rollup/plugin-image.md) ^3.0.3
- [electron-to-chromium](https://npm.io/package/electron-to-chromium.md) ^1.5.25
- [escape-string-regexp](https://npm.io/package/escape-string-regexp.md) ^2.0.0
- [babel-plugin-istanbul](https://npm.io/package/babel-plugin-istanbul.md) ^6.1.1
- [istanbul-lib-coverage](https://npm.io/package/istanbul-lib-coverage.md) ^3.2.2
- [jest-environment-node](https://npm.io/package/jest-environment-node.md) ^29.7.0
- [update-browserslist-db](https://npm.io/package/update-browserslist-db.md) ^1.1.0
- [babel-plugin-jest-hoist](https://npm.io/package/babel-plugin-jest-hoist.md) ^29.6.3
- [is-fullwidth-code-point](https://npm.io/package/is-fullwidth-code-point.md) ^3.0.0
- [istanbul-lib-instrument](https://npm.io/package/istanbul-lib-instrument.md) ^6.0.3
- [istanbul-lib-source-maps](https://npm.io/package/istanbul-lib-source-maps.md) ^4.0.1
- [jest-resolve-dependencies](https://npm.io/package/jest-resolve-dependencies.md) ^29.7.0
- [fast-json-stable-stringify](https://npm.io/package/fast-json-stable-stringify.md) ^2.1.0
- [json-parse-even-better-errors](https://npm.io/package/json-parse-even-better-errors.md) ^2.3.1
- [supports-preserve-symlinks-flag](https://npm.io/package/supports-preserve-symlinks-flag.md) ^1.0.0
- [babel-preset-current-node-syntax](https://npm.io/package/babel-preset-current-node-syntax.md) ^1.1.0

## Recent versions

- 0.0.14 (latest) — 2025-01-27
- 0.0.13 — 2024-12-23
- 0.0.12 — 2024-11-07
- 0.0.11 — 2024-11-07
- 0.0.10 — 2024-11-07
- 0.0.9 — 2024-11-07
- 0.0.8 — 2024-11-06
- 0.0.7 — 2024-11-06
- 0.0.6 — 2024-11-06
- 0.0.5 — 2024-11-06
- 0.0.4 — 2024-11-06
- 0.0.3 — 2024-11-06
- 0.0.2 — 2024-11-06

## README

Here's the revised README format with your requested changes:

---

# SG Chatbot UI Integration

Follow these steps to set up the **SG Chatbot UI** in a **React.js** or **Next.js** project.

---

### Step 1: Install the Package

```bash
npm install sg-chatbot-ui
```

---

## React.js Setup

1. **Import and Define Custom Elements**  
   Add the following lines in your `App.js` file:
   ```javascript
   import { defineCustomElements } from 'sg-chatbot-ui/loader';
   defineCustomElements(window);
   ```

2. **Use the Custom Element**  
   Add the `<chatbot-ui>` component at the bottom of `App.js`:
   ```jsx
   <chatbot-ui></chatbot-ui>
   ```

3. **Set Server URL**  
   In your `.env` file, add the server URL and update it with your current base URL:
   ```env
   REACT_APP_SERVER_URL=https://sentientgeeks.com
   ```

---

## Next.js Setup

1. **Import and Define Custom Elements in app route or**  
   In `App.js`, import and define the custom elements conditionally within a `useEffect` hook:
   ```javascript
   import { useEffect } from 'react';
   import { defineCustomElements } from 'sg-chatbot-ui/loader';

   useEffect(() => {
     if (typeof window !== "undefined") {
       defineCustomElements(window);
     }
   }, []);
   ```
1. **Import and Define Custom Elements in page route**  
   In `App.js`, import and define the custom elements conditionally within a `useEffect` hook:
   ```javascript
   import { useEffect } from 'react';

    useEffect(() => {
    if (typeof window !== "undefined") {
      import("sg-chatbot-ui/loader").then((module) => {
        module.defineCustomElements(window);
      });
    }
  }, []);
   ```

2. **Declare Custom Element in TypeScript**  
   Inside the `src` folder, create a file named `global.d.ts` to declare the `chatbot-ui` component:
   ```typescript
   declare namespace JSX {
     interface IntrinsicElements {
       "chatbot-ui": React.DetailedHTMLProps<
         React.HTMLAttributes<HTMLElement>,
         HTMLElement
       >;
     }
   }
   ```

3. **Use the Custom Element**  
   Add the `<chatbot-ui>` component at the bottom of `page.tsx`:
   ```jsx
   <chatbot-ui></chatbot-ui>
   ```

4. **Set Server URL**  
   In your `.env` file, add the server URL and update it with your current base URL:
   ```env
   NEXT_PUBLIC_SERVER_URL=https://sentientgeeks.com
   ```

---

With these steps, you should have the SG Chatbot UI integrated and ready to use in your application!

---
_Source: https://npm.io/package/sg-chatbot-ui · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
