Socket
Socket
Sign inDemoInstall

agora-chat

Package Overview
Dependencies
0
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    agora-chat

Agora chat web sdk


Version published
Weekly downloads
1.3K
increased by26.67%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

Agora chat sdk Introduction

This version is a preview and should only be used for testing purposes. For production use, please revert to the official stable release. If you require the use of this preview version, please contact Agora.io for assistance.

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 agora-chat
import AC from 'agora-chat';
  1. Initialize the SDK
const conn = new AC.connection({
	appKey: '<your app key>',
});
  1. Login chat server
const options = {
	user: 'userID',
	agoraToken: 'agoraToken',
};
conn.open(options);
  1. Send a message
let option = {
	chatType: 'singleChat',
	type: 'txt',
	to: 'userID',
	msg: 'message content',
};
let msg = AC.message.create(option);
conn.send(msg)
	.then(() => {
		console.log('send private text Success');
	})
	.catch((e) => {
		console.log('Send private text error');
	});

Reference

  • Agora Chat SDK Product Overview
  • Agora Chat SDK API Reference
  • Check our FAQ to see if your issue has been recorded.
  • Dive into Agora SDK Samples to see more tutorials
  • Take a look at Agora Use Case for more complicated real use case
  • Repositories managed by developer communities can be found at Agora Community
  • If you encounter problems during integration, feel free to ask questions in Stack Overflow

FAQs

Last updated on 30 Mar 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc