ng-talkk-chat-widget
v0.0.5
Published
`ng-talkk-chatbot` is an Angular library that provides a customizable chat widget component. You can easily integrate this chat widget into your Angular application.
Downloads
3
Readme
ng-talkk-chatbot
ng-talkk-chatbot
is an Angular library that provides a customizable chat widget component. You can easily integrate this chat widget into your Angular application.
Installation
To use ng-talkk-chatbot
in your Angular project, follow these steps:
1. Install the Library
You can install the library via npm:
npm install ng-talkk-chatbot
2. Import the Module
Import TalkkChatWidgetModule
into your Angular module.
// app.module.ts
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import { ChatWidgetModule } from 'ng-talkk-chat-widget';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
ChatWidgetModule // Import the library module
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
3. Use the Component
You can now use the lib-ng-talkk-chatbot
component in your templates.
<!-- app.component.html -->
<lib-ng-talkk-chatbot
[chatWidgetReferenceNo]="'your-chat-widget-reference-no'"
[botType]="'Chat'">
</lib-ng-talkk-chatbot>
Inputs
The lib-ng-talkk-chatbot
component accepts the following inputs:
chatWidgetReferenceNo
(string): The unique reference number for your chat widget. Required.botType
(string): The type of bot (e.g., 'Chat'). Defaults to 'Chat'.
Example
Here is a simple example of how to use the ng-talkk-chatbot
library in your Angular application:
// app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
chatWidgetReferenceNo = '<referenceno>';
botType = '<Chat|Full|Mobi>';
}
<!-- app.component.html -->
<lib-ng-talkk-chatbot
[chatWidgetReferenceNo]="chatWidgetReferenceNo"
[botType]="botType">
</lib-ng-talkk-chatbot>
Notes
- Ensure you have the appropriate permissions and API keys to use the chat widget service.
- The chat widget might load additional external scripts and styles, which could affect the performance of your application.
For iOS Cookie Configuration
If the bot is not working on iOS, follow these instructions to configure cookies:
Capacitor Cookies Plugin Configuration
Refer to the Capacitor Cookies Documentation for detailed information.
Add the following configuration in your capacitor.config.ts file:
import { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = {
plugins: {
CapacitorCookies: {
enabled: true,
},
},
};
export default config;
Third-Party Cookies on iOS
As of iOS 14, third-party cookies are not enabled by default. To get better support for cookies on iOS, add the following lines to your Info.plist file. You can include up to 10 domains:
<key>WKAppBoundDomains</key>
<array>
<string>www.mydomain.com</string>
<string>api.mydomain.com</string>
<string>www.myothercooldomain.com</string>
</array>
License
This library is licensed under the MIT License. See the LICENSE file for details.
Talkk_sdk
Talkk_sdk is a flutter package dependency that can be added to an existing flutter application.
It can be invoked like any other widget