Skip to content

sparkouttech/pikchat-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The JavaScript server library for Pikchat SDK implementations.


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
}
Key Value Sample value Description
senderId String 1234 logged in user's id
receiverId String 1235 receiver user's id
message String Hii siva message
messageType Number 1 1 - text message 2 - image

License

MIT

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published