Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
cordova-clarity
Advanced tools
A plugin to provide the Clarity experience for the Cordova applications.
A Cordova plugin that allows integrating Clarity with your Cordova/Ionic application.
cordova plugin add cordova-clarity
Run these commands to add the package:
npm i cordova-clarity cordova-plugin-device
ionic cap sync
Run this command to add the package:
ionic cordova plugin add cordova-clarity
var success = function(message) {}
var failure = function(message) {}
var idCallback = function(id) {}
var urlCallback = function(url) {}
let clarityConfig = {
logLevel: ClarityPlugin.LogLevel.None,
allowMeteredNetworkUsage: true
}
// Initialize Clarity.
ClarityPlugin.initialize("<ProjectId>", success, failure, clarityConfig);
// Pause Clarity capturing.
ClarityPlugin.pause(success, failure);
// Resume Clarity capturing if paused.
ClarityPlugin.resume(success, failure);
// Returns true if clarity was paused.
ClarityPlugin.isPaused(success, failure);
// Set custom user id.
ClarityPlugin.setCustomUserId("<CustomUserId>", success, failure);
// Set custom session id.
ClarityPlugin.setCustomSessionId("<CustomSessionId>",success, failure);
// Get current session id to correlate with other tools.
ClarityPlugin.getCurrentSessionId(idCallback, failure);
// Get current session url to correlate with other tools.
ClarityPlugin.getCurrentSessionUrl(urlCallback, failure);
// Set custom tag for the current session.
ClarityPlugin.setCustomTag("key", "value", success, failure);
Follows the same pattern as Cordova, but you have to define ClarityPlugin
and using clarityConfig to set isIonic
to true:
declare let ClarityPlugin: any;
var success = function(message: string) {}
var failure = function(message: string) {}
let clarityConfig = {
logLevel: ClarityPlugin.LogLevel.None,
allowMeteredNetworkUsage: true,
isIonic: true
}
// Initialize Clarity.
ClarityPlugin.initialize("<ProjectId>", success, failure, clarityConfig);
// If you're using Capacitor by Ionic, you might need to limit the plugin scope to Android platform only.
if(Capacitor.getPlatform() === "android"){
// Call Clarity initialize.
}
/**
* Initializes the Clarity plugin with the provided parameters.
* Note: this function has to be called once in your startup page.
*
* @param projectId [REQUIRED] The Clarity project id to send data to.
* @param success [REQUIRED] A callback to invoke when the initialization process succeeds.
* @param error [REQUIRED] A callback to invoke when the initialization process fails.
* @param config [OPTIONAL] The clarity config, if not provided default values are used.
*/
function initialize(projectId, success, failure, config = {})
/**
* The configuration that will be used to customize the Clarity behaviour.
*
* @param isIonic [OPTIONAL default = false] A flag that determines if this plugin is being used in an Ionic application.
* @param userId [OPTIONAL default = null] A custom identifier for the current user. If passed as null, the user id
* will be auto generated. The user id in general is sticky across sessions.
* The provided user id must follow these conditions:
* 1. Cannot be an empty string.
* 2. Should be base36 and smaller than "1Z141Z4".
* @param logLevel [OPTIONAL default = LogLevel.None] The level of logging to show in the device logcat stream.
* @param allowMeteredNetworkUsage [OPTIONAL default = false] Allows uploading session data to the servers on device metered network.
* @param enableWebViewCapture [OPTIONAL default = true] Allows Clarity to capture the web views DOM content.
* @param allowedDomains [OPTIONAL default = ["*"]] The whitelisted domains to allow Clarity to capture their DOM content.
* If it contains "*" as an element, all domains will be captured.
* @param disableOnLowEndDevices [OPTIONAL default = false] Disable Clarity on low-end devices.
* @param maximumDailyNetworkUsageInMB [OPTIONAL default = null] Maximum daily network usage for Clarity (null = No limit). When the limit is reached, Clarity will turn on lean mode.
*/
let clarityConfig = {
isIonic = false,
userId = null,
logLevel = ClarityPlugin.LogLevel.None,
allowMeteredNetworkUsage = false,
allowedDomains = ["*"],
disableOnLowEndDevices = false,
maximumDailyNetworkUsageInMB = null
}
cordova-android
version +11.0.0
.MIT
FAQs
A plugin to provide the Clarity experience for the Cordova applications.
The npm package cordova-clarity receives a total of 693 weekly downloads. As such, cordova-clarity popularity was classified as not popular.
We found that cordova-clarity demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.