pikchat-sdk
v0.0.11
Published
Sparkouttech chat library
Downloads
5
Readme
This library was developed by https://www.pikchat.co. Pik Chat, an instant messaging solution (SDK, API and App) for your business website and application to engage your users effectively and efficiently to scale the impact.
Pikchat SDK
Install
This project uses node and npm. Go check them out if you don't have them locally installed.
npm install pikchat-sdk
const pikchat = require('pikchat');
const express = require('express');
const app = express();
const http = require('http');
const server = http.createServer(app);
pikchat.setConfig(pikchat.CONSTANTS.MYSQL_HOST, 'localhost');
pikchat.setConfig(pikchat.CONSTANTS.MYSQL_USERNAME, 'root');
pikchat.setConfig(pikchat.CONSTANTS.MYSQL_PASSWORD, 'root');
pikchat.setConfig(pikchat.CONSTANTS.MYSQL_DATABASE, 'chat');
pikchat.connectMySQL();
pikchat.startPikchatEngine(server);
server.listen(3000, () => {
console.log('listening on *:3000');
});
Socket events
| S.No | Event name | Description | Action | | -----| ---------------------------------------------------- | --------------------------------------- |----------- | | 1. | SINGLE_CHAT_MESSAGE | | view | | 2. | SINGLE_CHAT_MESSAGE_DELIVERED | | view |
single chat message
Event name : SINGLE_CHAT_MESSAGE
Params :
{
"senderId" : "1234",
"receiverId" : "1235",
"message" : "hi siva",
"messageType" : 1
}