Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

agora-chat

Package Overview
Dependencies
Maintainers
2
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agora-chat

Agora chat websdk

  • 1.0.5
  • npm
  • Socket score

Version published
Weekly downloads
925
decreased by-1.49%
Maintainers
2
Weekly downloads
 
Created
Source

Agora chat sdk Introduction

Agora chat sdk provides complete instant messaging function development capabilities, shields/encapsulate and block its internal complex details, and provides a relatively simple and concise API interface to facilitate third-party applications to quickly integrate instant messaging functions for PC/mobile Web applications


Chat SDK can be integrated in the following way:

  1. Install
npm install agora-chat --save
  1. Import websdk
import websdk from 'agora-chat'
  1. Initialize the SDK
const WebIM = {};
const conn = (WebIM.conn = new websdk.connection({
	appKey: 'your app key',
}));
  1. Login chat server
const options = {
	user: 'username',
	pwd: 'password',
};
conn.open(options);
  1. Send a message
let option = {
	chatType: 'singleChat',
	type: 'txt',
	to: 'userID',
	msg: 'message content',
};
let msg = websdk.message.create(option);
conn.send(msg)
	.then(() => {
		console.log('send private text Success');
	})
	.catch((e) => {
		console.log('Send private text error');
	});

FAQs

Package last updated on 17 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc