Let's integrate our SDK in few minutes

Getting started#
Download SDK Files
Download

Introduction#

Through our Chat SDK for Web, you can efficiently integrate real-time chat into your web app. On the client-side implementation, you can initialize, configure and build the chat with minimal effort.

On the server-side, MirrorFly ensures reliable infra-management services for your chat within the app. All server setup related documents can be downloaded from control panel's download section. This and Initialization page provide the Chat SDK’s structure and installation steps, then goes through the preliminary steps of implementing the Chat SDK in your own project.

Note : The fastest way to see our Chat SDK in action is to build your chat app on top of our sample app. Make sure to change the application ID of the sample app to your own. To download sample app click here

Supported browsers#

BrowserSupported versions
Edge13 or higher
Chrome16 or higher
Firefox11 or higher
Safari7 or higher

SDK License Key#

Your SDK must be authenticated by MirrorFly server using License Key.

Please follow below step to get your license key:

Step 1: Create an account here in MirrorFly console, if you already have an account please goto step 3.

Step 2: Validate your account by following the steps provided in console and login to your account.

Step 3: Please login to your account here

Step 4: Copy license key under "Application info" in "Overview" page

SDK Installation#

Step 1: Download the latest SDK from MirrorFly Control Panel Download's section

Step 2: Extract the files from downloaded zip file and copy the dist folder into your application

Step 3: Include MirrorFly's script file into your index.html

<script src="dist/index.js"></script>

Step 4: Create a new file SDK.js in the project root and past below code.

const SDK = window.SDK;
export default SDK;

Step 5: Import the SDK into your application

import SDK from "./SDK";

SDK Installation for React Native#

Step 1: Download the latest SDK from MirrorFly Control Panel Download's section

Step 2: Extract the files from downloaded zip file and copy all the files from dist folder

Step 3: Create a new folder inside your project and paste all the copied files inside the folder

Step 4: Create a file SDK.js( you can name it as you want ) to export the SDK Object as follows. And then you can import the SDK Object from this file and use it.

import './index';
const SDK = window.SDK;
export default SDK;

Step 5: Make sure you install all the below mentioned peer dependencies with the version specified.

  1. react-native version should be any version
  2. @react-native-async-storage/async-storage version should be any version
  3. react-native-get-random-values version should be >=1.7.1

SDK Installation for Angular#

Step 1: Download the latest SDK from MirrorFly Control Panel Download's section.

Step 2: Extract the files from the downloaded zip file and copy all the files from the SDK folder.

Step 3: Create a new folder inside your project's Root folder and paste all the copied files inside the folder.

Step 4: Open your angular.json and find the property build => options => scripts, inside the scripts array, add the relative file paths of Downloaded SDK JS files.

Step 5: Add the below line in the Root component (before @Component Decorator).

declare var SDK: any;

Step 6: Inside the Root component's ngOnInit follow our Initialization process.

Note: Minimum Required Angular version 8.3.29

Terminology#

The below table contains some mostly used keywords in sdk with their explanation

KeywordExplanation
userIdUnique ID assigned for each user Ex: 12345678 (any alphanumeric). The below characters is not allowed in userId: U+0022 (") U+0026 (&) U+0027 (') U+002F (/) U+003A (:) U+003C (<) U+003E (>) U+0040 (@) userID should follow below specification: https://xmpp.org/extensions/xep-0106.html
userJiduserID+@+domain of the chat server Ex. 12345678@xmpp.chatsystem.dev.contus.us
groupJidUnique ID assigned for each group Ex: group123456 (any alphanumeric). GroupJID = groupID +@mix.+domain of the chat server Ex: group123456@mix.xmpp.mirrorfly.dev.contus.us`