Integrating AppLozic chat plugin for an angular5 project

447 views Asked by At

I was trying to integrate a third party chat plugin to my angular 5 project but having a very hard time doing it. I could not get what their documentation wants to say or how to carry on it. If anyone has integrated it before then please help me! Here is the npm Appklozic link here if you want to see the documentation.

1

There are 1 answers

0
jesh-stha On BEST ANSWER

Hence there are no @types for Applozic chat, there are two ways to integrate with angular 2+.

  1. Write a typings for Applozic, which is very time consuming and need to know all the functions of applozic
  2. Use applozic.js and implement their function, which is how i did it.

STEPS:

  • Run : npm install applozic.
  • Add applozic.js in angular.cli.json file.
  • declare Applozic: any; in your typings.d.ts file.
  • Now you can import applozic in app component and call the init function reference to it.

    import * as AppLozic from 'applozic';
    
    AppLozic.init({{appId: 'PUT_APPLICATION_KEY_HERE', userId: 'PUT_USERID_HERE', userName: 'PUT_USER_DISPLAYNAME_HERE'});