Installation

Web Chat Core SDK Installation

This document will guide you in installing the core web chat SDK.

Core Web SDK signup pageCore Web SDK signup page

Core Web SDK signup page

Download the npm package

$ npm i @applozic/core-sdk

Import the Applozic Client

import ApplozicClient from '@applozic/core-sdk';

Set up your Application Client

🚧

Replace with your App ID

Replace 'YOUR-APPLOZIC-APP-ID' with your app ID. Check out this tutorial to know how: https://www.applozic.com/blog/applozic-android-sdk-tutorial-1/

const client = new ApplozicClient('YOUR-APPLOZIC-APP-ID', {
  events: {
    onMessageReceived: ({ message }) => {
      console.log('onMessageReceived', { message });
    },
    onMessageDelivered: ({ message }) => {
      console.log('onMessageDelivered', { message });
    },
    onMessageRead: (contactId, messageKey) => {
      console.log('onMessageRead', { contactId, messageKey });
    },
    onMessageSent: ({ message }) => {
      console.log('onMessageSent', { message });
    },
    onMessageSentUpdate: message => {
      console.log('onMessageSentUpdate', { sentMessageUpdate: message });
    },
    onMessageDeleted:  (contactId, messageKey) => {
      console.log('onMessageDeleted', { contactId, messageKey });
    },
    onConversationRead: userId => {
       console.log('onConversationRead', { userId });
    },

    onConversationDeleted: contactId => {
      console.log('onConversationDeleted', { contactId });
    },

    onUserActivated: message => {
      console.log('onUserActivated', { onUserActivated: message });
    },
    onUserConnect: message => {
      console.log('onUserConnect', { userConnected: message });
    },
    onUserOnlineStatus: (userId, isOnline, timestamp) => {
     console.log('onUserOnlineStatus', { userId, isOnline,  timestamp});
    },
    onTypingStatus: (userId, status) => {
      console.log('onTypingStatus', { userId, status});
    }
  }
});

What’s Next
Did this page help you?