JSPM

  • Created
  • Published
  • Downloads 32
  • Score
    100M100P100Q87208F
  • License MIT

A library wrapping requests to the Beekeeper API for easy access

Package Exports

  • beekeeper

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (beekeeper) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Beekeeper JavaScript SDK

A npm package providing easy access to the Beekeeper universe.

Beekeeper is a mobile-first communication platform that reaches every shift, location, and language through real-time messaging and targeted streams. Managers keep frontline teams productive and turnover low by automating workflows, while leveraging an analytics dashboard to measure engagement. Beekeeper integrates with existing operational systems and makes them accessible in one central portal.

Learn more about Beekeeper at https://beekeeper.io.

Installation

Install npm package with:

npm install --save beekeeper

or

yarn add beekeeper

Tenant Access

In order to use this package on a tenant, you will need to gather two information:

  • Tenant URL e.g. https://<tenant>.beekeeper.io
  • Bot Access Key e.g. fae00bbc-b0f6-4ace-8e13-7d53b58076e1

Although, it would also be possible to use other authorization methods, the prefered way is to use a bot for interaction with the API.

First, we have to navigate to the dashboard: Web App

Now, we navigate to the bot page: Dashboard Navigation

In right corner, we can create a new bot: Bot Page with Create Button

Fill details in the popover: Creation Popover

A new access key has been created: Bot Page with Access Key

ChatBot

An easy way to get started with the Beekeeper SDK is a chatbot. An example is shown below:

const { ChatBot } = require('beekeeper');

const credentials = {
    tenantURL: 'https://<tenant>.beekeeper.io',
    token: '540a254c-ea8b-4ae7-a456-d8437b7314d6',
};

const bot = new ChatBot(credentials);


bot.on('message', (ctx) => {
    // Listen to new messages and reply with received text
    ctx.replyWithText(ctx.text);
});

bot.on('started', () => {
    // Listen for started event and indicate readiness
    console.log('Bot is started!');
})

// Start listening for events
bot.start();

More examples can be found in the examples folder.