# ringcentral-personal-chatbot

> RingCentral personal chatbot framework

Latest version **1.1.1** (published 2022-05-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install ringcentral-personal-chatbot
pnpm add ringcentral-personal-chatbot
yarn add ringcentral-personal-chatbot
bun add ringcentral-personal-chatbot
```

Provides the commands `rcpf`, `ringcentral-personal-chatbot`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2022-05-30 |
| First published | 2019-05-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 16 |
| Unpacked size | 720.5 KB |
| Known vulnerabilities | 0 (+20 in 7 direct dependencies) |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Drake Zhao |
| Maintainers | zxdong262 |
| Keywords | RingCentral, Chatbot, AI |

## Links

- npm: https://www.npmjs.com/package/ringcentral-personal-chatbot
- Repository: https://github.com/ringcentral/ringcentral-personal-chatbot-js
- Homepage: https://github.com/ringcentral/ringcentral-personal-chatbot-js#readme
- Issues: https://github.com/ringcentral/ringcentral-personal-chatbot-js/issues
- npm.io page: https://npm.io/package/ringcentral-personal-chatbot

## Dependencies (16)

- [pug](https://npm.io/package/pug.md) 3.0.2
- [morgan](https://npm.io/package/morgan.md) 1.10.0
- [nanoid](https://npm.io/package/nanoid.md) 3.3.2
- [express](https://npm.io/package/express.md) 4.17.3
- [commander](https://npm.io/package/commander.md) 2.20.3
- [sequelize](https://npm.io/package/sequelize.md) 6.19.0
- [@rc-ex/core](https://npm.io/package/@rc-ex/core.md) 0.12.4
- [express-jwt](https://npm.io/package/express-jwt.md) 6.1.1
- [@rc-ex/retry](https://npm.io/package/@rc-ex/retry.md) 0.8.2
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) 8.5.1
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) 7.17.9
- [json-deep-copy](https://npm.io/package/json-deep-copy.md) 1.1.6
- [dynamo-sequelize](https://npm.io/package/dynamo-sequelize.md) 3.0.0
- [express-basic-auth](https://npm.io/package/express-basic-auth.md) ^1.2.1
- [timeout-as-promise](https://npm.io/package/timeout-as-promise.md) 1.0.0
- [@rc-ex/authorize-uri](https://npm.io/package/@rc-ex/authorize-uri.md) 0.8.5

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2022-05-30
- 1.0.0-beta.3 (beta) — 2022-04-20
- 1.1.0 — 2022-05-30
- 1.0.6 — 2022-04-21
- 1.0.5 — 2022-04-21
- 1.0.4 — 2022-04-21
- 1.0.3 — 2022-04-21
- 1.0.2 — 2022-04-21
- 1.0.1 — 2022-04-20
- 1.0.0 — 2022-04-20
- 1.0.0-beta.2 — 2022-04-20
- 1.0.0-beta.1 — 2022-04-20
- 1.0.0-beta.0 — 2022-04-20
- 0.12.8 — 2021-12-01
- 0.12.7 — 2021-10-02
- … 62 more at https://npm.io/package/ringcentral-personal-chatbot/versions

## README

# ringcentral-personal-chatbot-js <!-- omit in toc -->

RingCentral personal chatbot framework.

![ ](https://github.com/rc-personal-bot-framework/ringcentral-personal-chatbot-skill-faq/raw/master/screenshots/s1.png)

- [Quick start](#quick-start)
- [Build and run in production](#build-and-run-in-production)
- [Token renew](#token-renew)
- [Use as CLI tool](#use-as-cli-tool)
- [Write a personal bot](#write-a-personal-bot)
- [Write/use a personal bot skill](#writeuse-a-personal-bot-skill)
- [Build-in commands](#build-in-commands)
- [Origin](#origin)
- [Credits](#credits)
- [License](#license)

## Quick start

First, need create a AWS account, we will use free local AWS dynamodb, and put your aws credentials in `~/.aws/credentials`, check [https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html)

Let's start a simple chatbot server and login to it with you sandbox glip account, and you account will auto respond to `hello` with `Hi`(any private message or message mentioned you).

```bash
# get the code
git clone git@github.com:ringcentral/ringcentral-personal-chatbot-js.git
cd ringcentral-personal-chatbot-js

# install dependecies
npm i

# start proxy server, this will make your local bot server can be accessed by RingCentral service
npm run ngrok

# will show
Forwarding                    https://xxxx.ap.ngrok.io -> localhost:6066
# Remember the https://xxxx.ap.ngrok.io, we will use it later

# start local dynamodb
npm run dynamo
```

Login to [developer.ringcentral.com](https://developer.ringcentral.com/) and create REST API App:

- Application Type: Public
- Platform Type: Browser-based
- Carrier: accept the default values
- Permissions Needed: Accounts, Team messaging, Read Accounts, Webhook Subscriptions
- Set OAuth Redirect URI: Using your ngrok HTTPS URL from above, enter in the following value: `https://xxxx.ap.ngrok.io/rc/oauth`.

```bash
cp .env.sample .env
# then fill all required fields in .env, you can get client ID / secret from app setting

# run sample hello bot
npm start

# start client dev server
npm run c

```

Then visit [https://xxxx.ap.ngrok.io](https://xxxx.ap.ngrok.io) to login, after auth, when someone talk to you with "hello"(any private message or message mentioned you), you will auto respond with "Hi".

## Build and run in production

```bash
# build
npm run build

# run prodcution code
npm run p
# or
cross-env NODE_ENV=production node bin/rcpf.js example-bots/hello.js

# proxy for production code
npm run ngrok-p
```

## Token renew

todo

## Use as CLI tool

I will as simple as this:

```bash
npx ringcentral-personal-chatbot your-bot-file.js
```

- Check example-bots folders for bot examples, it is quite simple, you could just write your own.
- Check [ringcentral-personal-bot-template-js](https://github.com/rc-personal-bot-framework/ringcentral-personal-bot-template-js) as a realworld example which uses [ringcentral-personal-chatbot-skill-faq](https://github.com/rc-personal-bot-framework/ringcentral-personal-chatbot-skill-faq) and [ringcentral-personal-bot-skill-pack-simple](https://github.com/rc-personal-bot-framework/ringcentral-personal-bot-skill-pack-simple), it only need [28 lines code](https://github.com/rc-personal-bot-framework/ringcentral-personal-bot-template-js/blob/master/src/server/index.js).

## Write a personal bot

[docs/write-a-bot.md](docs/write-a-bot.md)

## Write/use a personal bot skill

[docs/write-use-a-skill.md](docs/write-use-a-skill.md)

## Build-in commands

- `__test__`: show bot info.

## Origin

It is a project for RingCentral Xiamen Office 2019 Hackathon. It begin with [Jakob Lewei](https://github.com/orgs/rc-personal-bot-framework/people/jakob-lewei)'s idea about fuzzy matching FAQ bot, then I decided to make it more generic: a bot framework for personal glip account.

## Credits

It is based on the these projects, especially [Tyler](https://github.com/tylerlong)'s work.

- [Tyler](https://github.com/tylerlong)'s [RingCentral chatbot js](https://github.com/ringcentral/ringcentral-chatbot-js)
- [RingCentral chatbot python](https://github.com/zxdong262/ringcentral-chatbot-python).
- [https://github.com/zxdong262/ringcentral-chatbot-voicemail-helper](https://github.com/zxdong262/ringcentral-chatbot-voicemail-helper)

## License

MIT

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