# @releai/rb-node-sdk

> RELE.AI Node SDK provides a simple interface to manage integrated applications

Latest version **0.1.8** (published 2021-08-05) · Apache License license · 0 weekly downloads

## Install

```sh
npm install @releai/rb-node-sdk
pnpm add @releai/rb-node-sdk
yarn add @releai/rb-node-sdk
bun add @releai/rb-node-sdk
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2021-08-05 |
| First published | 2020-11-30 |
| Weekly downloads | 0 |
| License | Apache License |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 47.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Elon Salfati |
| Maintainers | elonsalfati, matanyechiel, saar |
| Keywords | rele.ai, sdk, chat, bot |

## Links

- npm: https://www.npmjs.com/package/@releai/rb-node-sdk
- Repository: https://github.com/rele-ai/rb-node-sdk
- Homepage: https://github.com/rele-ai/rb-node-sdk#readme
- Issues: https://github.com/rele-ai/rb-node-sdk/issues
- npm.io page: https://npm.io/package/@releai/rb-node-sdk

## Dependencies (3)

- [winston](https://npm.io/package/winston.md) ^3.3.3
- [@grpc/grpc-js](https://npm.io/package/@grpc/grpc-js.md) ^1.3.6
- [google-protobuf](https://npm.io/package/google-protobuf.md) ^3.17.0

## Recent versions

- 0.1.8 (latest) — 2021-08-05
- 0.1.6 — 2021-08-05
- 0.1.5 — 2021-05-25
- 0.1.4 — 2021-05-24
- 0.1.3 — 2021-05-23
- 0.1.2 — 2021-01-12
- 0.1.1 — 2020-11-30
- 0.1.0 — 2020-11-30

## README

# RELE.AI Node SDK

RELE.AI Node SDK provides an easy interface to manage, create, and integrate applications to Clara.

## Create Application
Please visit: https://github.com/rele-ai/cli

## Client Usage Examples
```javascript
const { RBC } = require("@releai/rb-node-sdk")

// Initiate new releai bot client.
const rbc = new RBC({
    appId,
    appHash,
    host,
    port,
})

// send notification to endpoint
const response = await rbc.notify(
    // send the operation key
    "new_contact",

    // send the payload
    {
        "foo": {
            "bar": 1
        }
    },

    // send additional headers
    {
        "example-header-key": "value"
    }
)

// handle output - JSON
console.log(response)
```

## REST Formatter Example
```javascript
const { format } = require("@releai/rb-node-sdk")

// format payload to gRPC struct format
const payload = format({
    // payload
})
```

## Server Usage Example
```javascript
const { RBS } = require("@releai/rb-node-sdk")

// initiate the bot server
const rbs = new RBS({
    appId,
    appHash,
})

// Register operation handler for a given operation
rbs.registerOperation("record_note", async (req, res) => {
    // do some logic here...

    // reply with the payload data
    res.send(200, {
        // response payload
    })
})

// run server
rbs.listen(50003)
```

---
_Source: https://npm.io/package/@releai/rb-node-sdk · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
