All Projects → wireapp → bot-sdk-node

wireapp / bot-sdk-node

Licence: other
🤖

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to bot-sdk-node

ESP8266-I2C-Driver
Fixed built-in I2C driver for Arduino ESP8266 core
Stars: ✭ 74 (+25.42%)
Mutual labels:  wire
arduino-esp32
Arduino core for the ESP32
Stars: ✭ 38 (-35.59%)
Mutual labels:  wire
wire.css
Simple and responsive flexbox based Sass Framework
Stars: ✭ 42 (-28.81%)
Mutual labels:  wire
wire-service-jest-util
Utility library for @-wire Lightning Web Component tests
Stars: ✭ 18 (-69.49%)
Mutual labels:  wire
terms-dictionary
Simple definitions of terms, acronyms, abbreviations, companies, and projects related to financial services and Moov.
Stars: ✭ 48 (-18.64%)
Mutual labels:  wire
golang-example-app
Example application
Stars: ✭ 138 (+133.9%)
Mutual labels:  wire
Wire Android
☎️ Wire for Android
Stars: ✭ 2,488 (+4116.95%)
Mutual labels:  wire
Wire Server
🇪🇺 Wire back-end services
Stars: ✭ 2,392 (+3954.24%)
Mutual labels:  wire
Wire Ios
📱 Wire for iOS (iPhone and iPad)
Stars: ✭ 3,079 (+5118.64%)
Mutual labels:  wire
wire-web-packages
Collection of npm modules created by Wire's web team.
Stars: ✭ 53 (-10.17%)
Mutual labels:  wire
microservice-template-ddd
Golnag microservice-template by DDD
Stars: ✭ 13 (-77.97%)
Mutual labels:  wire
purescript-wire
Events and Signals for FRP. Monad instances included
Stars: ✭ 13 (-77.97%)
Mutual labels:  wire
golangRestfulAPISample
Sample Restful app with chi router (golang)
Stars: ✭ 116 (+96.61%)
Mutual labels:  wire
wire
FedWire funds service file parser and writer. The HTTP server is available in a Docker image and the Go package is available.
Stars: ✭ 52 (-11.86%)
Mutual labels:  wire
PCF8575 library
Library to use i2c digital expander with arduino, esp8266 and esp32. Can read write digital value with only 2 wire (perfect for ESP-01).
Stars: ✭ 28 (-52.54%)
Mutual labels:  wire
wire-ios-cryptobox
wire.com
Stars: ✭ 22 (-62.71%)
Mutual labels:  wire

Wire™

Wire logo

Wire Bot Node.js

Wire bot API is currently in alpha.

Bot registration and creation

  • Run manage.sh from a terminal and reister as Wire Service Provider

  • Register as Wire Service Provider:

    • Email - This is a separate developer account, you can reuse the same email (if you've added an email to your Wire account)
    • Website (you can leave it blank: https://)
    • Developer description (e.g. “Pied Piper”)
    • Verification email
    • Account approved email (will happen immediatelly)
  • Create a new service with new-service command

    • Name - name of the bot, will also be used as the URL for the bot
    • Base URL (you can put: https://[Your_Public_IP]:8050)
    • Description
    • Copy and paste the RSA key (found in ./hello-bot/certs/pubkey.pem) $ADD?
  • Enable your service with update-service-conn command

Installation

git clone https://github.com/wireapp/bot-sdk-node/
npm install bot-sdk-node

Usage

Create service key and certificate:

openssl genrsa -out server.key 4096
openssl req -new -key server.key -out csr.pem
openssl x509 -req -days 7300 -in csr.pem -signkey server.key -out server.crt
openssl rsa -in server.key -pubout -out pubkey.pem

Then proceed to create your first bot (take a look at example/echo_text_bot.js):

const service = require('wire-bot-sdk-node');

service.createService(options, (bot) => {
  // add listeners
});
  • The options argument has the following options:

    • port - https server port (serve on which wire will send requests),
    • key - https server private key (server.key created above),
    • cert - https server certificate (server.crt created above),
    • auth - auth_token that you received from DevBot
    • storePath - file system path where cryptobox stuff will be stored
  • The function that is passed to createService is called when the service is created and is given a bot instance. Bot object is an EventEmitter and emits the following listeners:

    • bot.on('message', (from, message) => {}); // message from user
    • bot.on('join', (members, conversation) => {}); // new user(s) joined the conversation
    • bot.on('leave', (members, conversation) => {}); // user(s) that left the conversation
    • bot.on('rename', (name, conversation) => {}); // conversation renamed

Use sendMessage to send message back to user

bot.sendMessage(message, (sendStatus) => {});
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].