Embedding appEQ
Before calling any of the AppEQ APIs, you must inject the below single line script tag in the header or footer of your web application.
<script type="text/javascript" src="https://embed.appeq.ai/content.js"></script>
The above script loads the required APIs and the chat widget to your application. After the loading of the above script you must initialise using the init() API.
APIs
The AppEQ
is a global object which provides operations as static methods. They are used from within your application after login.
AppEQ.init() - Initializing appEQ widget after login.
AppEQ.init({
// name of the current logged in user
name: username,
//real emailid of the user
email_id: email_id,
// Identifier for the multi-tenancy of data and information.
//This can be a name or a unique ID.
tenant_id: domain,
// partners unique token provided by AppEQ team.
partner_id: id,
// Image link to the user avatar
avatar_url: 'valid_image_link'
});
Parameters
name | The display name of the logged in user. This is a mandatory field. |
email_id | Logged in users email Id. This is a mandatory field. |
tenant_id | This helps in multi tenancy and grouping of users. All users from a single tenant can interact with each other. |
partner_id | This is a global ID provided by AppEQ team for an account or organization. You can have multiple tenants in a single organization but a different partner Id will be like a different account. |
avatar_url | This should point to a valid image path. Ideally should be a square size image. |
Example API:
// User Object
const u = {
fname: 'Rajat',
lname: 'Shukla',
picture: 'https://randomuser.me/api/portraits/men/61.jpg',
email_id: 'rajat@example.com'
}
AppEQ.init({
name: (u.fname + ' ' + u.lname),
email_id: u.email_id,
avatar_url: u.picture,
// for multi tenancy
tenant_id: 'example.com',
// id provided by AppEQ.
partner_id: '7cb82ec0-185a-4767-9c7f-038b5b6c84de'
});
AppEQ.logout() - Takes no parameters. After your application is closed, you should call this method to clear any session information from AppEQ chat.