All Collections
Embedded appEQ
Embedded appEQ Integration
Embedded appEQ Integration
Mano avatar
Written by Mano
Updated over a week ago

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.
This is the name which shows up in your chats.

email_id

Logged in users email Id. This is a mandatory field.
The user preferences and auto login is configured through this email.

NOTE:
- This should be a valid company email. Public email id is not allowed, initialization will fail.

tenant_id

This helps in multi tenancy and grouping of users. All users from a single tenant can interact with each other.

NOTE:
This must an alphanumeric id without any spaces. UUID is allowed.

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.

NOTE:
This is a required parameter and will be given by AppEQ team. Please contact support for your ID

avatar_url

This should point to a valid image path. Ideally should be a square size image.

This is not a mandatory field. If not provided through API, it can be uploaded from within the app.

NOTE:
Avoid using large images, as it will slow down the performance and loading for all users which visit the users page. An ideal image size should be less than 1 MB.

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.


Did this answer your question?