react-microsoft-clarity
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

react-microsoft-clarity

Small component to implement Microsoft Clarity into your React Application

Installation

npm install react-microsoft-clarity --save

Use / Example

import { clarity } from 'react-microsoft-clarity';

// Start seeing data on the Clarity dashboard with your id
clarity.init(id);

// Identify the user
clarity.identify('USER_ID', { userProperty: 'value' });

// Cookie consent
clarity.consent();

// Setup a custom tag
clarity.setTag('key', 'value');

// Upgrade session
clarity.upgrade('upgradeReason');

// Check if Clarity has been initialized before calling its methods
if (clarity.hasStarted()) {
  clarity.identify('USER_ID', { userProperty: 'value' });
}
  • id: Stands for 'Clarity ID' - Your site's ID. This is the ID which tells Clarity which site settings it should load and where it should save the data collected.

You can learn more from Clarity Docs

Readme

Keywords

Package Sidebar

Install

npm i react-microsoft-clarity

Weekly Downloads

14,891

Version

1.2.0

License

MIT

Unpacked Size

5.06 kB

Total Files

6

Last publish

Collaborators

  • marcoperson