npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cometchat-pro/chat

v3.0.13

Published

A complete chat solution.

Downloads

32,704

Readme

CometChat Javascript SDK

CometChat Pro enables you to add voice, video & text chat for your website & app. This guide demonstrates how to add chat to a WebSite using CometChat Pro.

Features

Extensions

Push Notification | Email Notification | SMS Notification | Thumbnail Generation | Link Preview | Rich Media Preview | Voice Transcription | Smart Reply | Message Translation | Emojis | Polls | Reactions | Stickers | Video Broadcasting | Collaborative Documents | Collaborative Whiteboards | Data Masking Filter | Profanity Filter | Image Moderation| Sentiment Analysis | In-flight Message Moderation | Virus & Malware Scanner | XSS Filter

Platform GitHub repo size GitHub contributors GitHub stars Twitter Follow

Prerequisites :star:

Before you begin, ensure you have met the following requirements: ✅   You have Visual Studio Code or any other code editor installed in your machine. ✅   You have npm installed in your machine. ✅   You have read CometChat Key Concepts.

Installing CometChat Javascript SDK

Setup :wrench:

To setup Javascript SDK, you need to first register on CometChat Dashboard. Click here to sign up.

i. Get your Application Keys :key:

Signup for CometChat and then:

  1. Create a new app: Click Add App option available → Enter App Name & other information → Create App
  2. At the Top in QuickStart section you will find Auth Key & App ID or else you can head over to the API & Auth Keys section and note the Auth Key and App ID

ii. Add the CometChat Dependency

	npm install @cometchat-pro/[email protected] --save
  <script type="text/javascript" src="https://unpkg.com/@cometchat-pro/[email protected]/CometChat.js"></script>

You can refer to the below link for instructions on how to do so: 📝 Add CometChat Dependency

Configure CometChat Javascript SDK

i. Initialize CometChat 🌟

We suggest you call the init() method on app startup, preferably in the index.js file.

var appID = "APP_ID";
var region = "REGION";
var appSetting = new CometChat.AppSettingsBuilder().subscribePresenceForAllUsers().setRegion(region).build();
CometChat.init(appID, appSetting).then(
  () => {
    console.log("Initialization completed successfully");
  },
  error => {
    console.log("Initialization failed with error:", error);
  }
);

| :information_source:   Note: Make sure to replace region and appID with your credentials. | |------------------------------------------------------------------------------------------------------------|

ii. Create User 👤

Once initialisation is successful, you will need to create a user. You need to use createUser() method to create user on the fly.

let authKey = "AUTH_KEY";
var uid = "user1";
var name = "Kevin";

var user = new CometChat.User(uid);

user.setName(name);

CometChat.createUser(user, authKey).then(
  user => {
    console.log("user created", user);
  },error => {
    console.log("error", error);
  }
);

:information_source: Note: Make sure that UID and name are specified as these are mandatory fields to create a user.

iii. Login User 👤

Once you have created the user successfully, you will need to log the user into CometChat using the login() method.

var UID = "SUPERHERO1";
var authKey = "AUTH_KEY";

CometChat.getLoggedinUser().then(
  user => {
    if(!user){
      CometChat.login(UID, authKey).then(
        user => {
          console.log("Login Successful:", { user });    
        },
        error => {
          console.log("Login failed with exception:", { error });    
        }
      );
    }else{
      // User already logged in
    }
  }, error => {
    console.log("getLoggedinUser failed with exception:", { error });
  }
);

| :information_source:   Note - The login() method needs to be called only once. Also replace AUTH_KEY with your App Auth Key. | |------------------------------------------------------------------------------------------------------------|

📝 Please refer to our Developer Documentation for more information on how to configure the CometChat Pro SDK and implement various features using the same.

Learn more about UI-Kit

Angular UI Kit | React UI Kit | Vue UI Kit

Contributors :clap:

Thanks to the following people who have contributed to this project: 👨‍💻 @ajaygajra 👨‍💻 @mayur-bhandari

Contact :mailbox:

Contact us via real time support present in CometChat Dashboard.