Skip to content

ronaksoft/river-service

Repository files navigation

River Messaging App Web Service

Library for inserting River in your webpage

This is a package for integrating river into your webapp, check out River.

⭐️ Features

  • RTL Support
  • Jest unit testing
  • Daily dependabot dependency updates

📦 Installation

npm install river-service

💎 Usage

const opts = {
    rtl: false,
    theme: 'dark',
};
const userInfo = {
    firstname: 'FIRST_NAME',
    lastname: 'LAST_NAME',
    workspace: 'cyrus.river.im',
    phone: '23740077'
};

let riverService = window.RiverService.default;
let srv = new riverService(opts);
srv.onload = () => {
    srv.setUserInfo(userInfo).then((res) => {
        console.log(res);
    });
}

Options

Property Default Type
url https://web.river.im string
rtl false boolean
theme '' string
el (appends new element) HTMLElement

User info object

Property Default Type
firstname '' string
lastname '' string
workspace 'cyrus.river.im' string
phone 0 number

✍️ Methods

  • setUserInfo(userInfo)
  • toggleVisible(boolean) toggles visibility of badge
  • setRTL(boolean)
  • setTheme(string)
  • halt() Removes iframe from page temprorary but still button is in access.
  • resume() Inserts the iframe in page.
  • destroy() Removes element from page.

✅ Websites built with this lib

  • Nested - Nested - Team Commiunication Platform

About

River service for embedded use

Resources

License

Stars

Watchers

Forks

Packages

No packages published