Because there are no predefined @types for Applozic chat, developers have two options to integrate it with Angular 2+.
- Create typings for Applozic, a tedious and time-consuming task that requires knowledge of all the functions of the applozic.
- Utilize applozic.js and incorporate their functions, which is the method I chose.
STEPS:
- Execute:
npm install applozic
.
- Include
applozic.js
in the angular.cli.json
file.
- Add
declare Applozic: any;
in your typings.d.ts file.
You can now import applozic into the app component and call the init function
by referring to it.
import * as AppLozic from 'applozic';
AppLozic.init({{appId: 'PUT_APPLICATION_KEY_HERE', userId: 'PUT_USERID_HERE', userName: 'PUT_USER_DISPLAYNAME_HERE'});