Cordova and Ionic SDK Installation
Important
Currently, Cordova/Ionic packages only support Android platform.
Cordova
Note
Clarity requires cordova-android version +11.0.0.
Step 1
To add the package, run the following command.
cordova plugin add cordova-clarity
Step 2
Add the code to start Clarity.
var success = function(message) {}
var failure = function(message) {}
ClarityPlugin.initialize("<ProjectId>", success, failure);
Refer to the available APIs and how to use them here.
Step 3
After integrating Clarity with your application, to test it on a device or an emulator, ensure that:
- Your device/emulator is connected to the internet.
- Your device/emulator Android version is within the supported range specified at Platform/Framework Support Matrix.
- Your first run might require setting the log level to Verbose to obtain the Clarity logs. These logs might be helpful in identifying the initialization errors, if any.
Allow approximately 2 hours for complete sessions to appear in your Clarity project on the Clarity website. However, in-progress sessions can still be viewed in real time. See Clarity Recordings in Real Time.
Ionic (Capacitor)
Step 1
To add the package, run these commands.
npm install cordova-clarity cordova-plugin-device
Step 2
Add this code to start Clarity.
var success = function(message: string) {}
var failure = function(message: string) {}
declare let ClarityPlugin: any;
ClarityPlugin.initialize("<ProjectId>", success, failure, {isIonic: true});
Refer to the available APIs and how to use them here.
Step 3
Run this command:
ionic cap sync
Step 4
After integrating Clarity with your application, to test it on a device or an emulator, ensure that:
- Your device/emulator is connected to the internet.
- Your device/emulator Android version is within the supported range specified at Platform/Framework Support Matrix.
- On your first run, you might need to set the log level to Verbose to get the Clarity logs. These logs might be helpful in identifying the initialization errors, if any.
Allow approximately 2 hours for complete sessions to appear in your Clarity project on the Clarity website. However, in-progress sessions can still be viewed in real time. See Clarity Recordings in Real Time.
Ionic (Cordova)
Note
Clarity requires cordova-android version +11.0.0.
Step 1
To add the package, run the following command.
ionic cordova plugin add cordova-clarity
Step 2
Add the code to start Clarity.
var success = function(message: string) {}
var failure = function(message: string) {}
declare let ClarityPlugin: any;
ClarityPlugin.initialize("<ProjectId>", success, failure, {isIonic: true});
Refer to the available APIs and how to use them here.
Step 3
After integrating Clarity with your application, to test it on a device or an emulator, ensure that:
- Your device/emulator is connected to the internet.
- Your device/emulator Android version is within the supported range specified at Platform/Framework Support Matrix.
- On your first run, you might need to set the log level to Verbose to get the Clarity logs. These logs might be helpful in identifying the initialization errors, if any.
Allow approximately 2 hours for complete sessions to appear in your Clarity project on the Clarity website. However, in-progress sessions can still be viewed in real time. See Clarity Recordings in Real Time.
FAQ
For more answers, refer to FAQ.