Gathering detailed insights and metrics for clevertap-web-sdk
Gathering detailed insights and metrics for clevertap-web-sdk
npm install clevertap-web-sdk
Typescript
Module System
Node Version
NPM Version
88.5
Supply Chain
100
Quality
98.4
Maintenance
100
Vulnerability
100
License
CleverTap Web SDK - v1.12.1
Published on 06 Feb 2025
CleverTap Web SDK - v1.12.0
Published on 28 Jan 2025
CleverTap Web SDK - v1.11.16
Published on 20 Jan 2025
CleverTap Web SDK - v1.11.15
Published on 14 Jan 2025
CleverTap Web SDK - v1.11.14
Published on 19 Dec 2024
CleverTap Web SDK - v1.11.13
Published on 18 Dec 2024
JavaScript (98.51%)
TypeScript (1.06%)
HTML (0.29%)
CSS (0.12%)
Sass (0.01%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
1,076,782
Last Day
25
Last Week
25
Last Month
27,389
Last Year
413,168
15 Stars
1,156 Commits
18 Forks
13 Watching
145 Branches
26 Contributors
Minified
Minified + Gzipped
Latest Version
1.12.1
Package Id
clevertap-web-sdk@1.12.1
Unpacked Size
1.10 MB
Size
275.73 kB
File Count
19
NPM Version
6.14.12
Node Version
10.24.1
Publised On
06 Feb 2025
Cumulative downloads
Total Downloads
Last day
0%
25
Compared to previous day
Last week
-99.5%
25
Compared to previous week
Last month
-18.2%
27,389
Compared to previous month
Last year
13.1%
413,168
Compared to previous year
21
The CleverTap Web SDK for Customer Engagement and Analytics
CleverTap brings together real-time user insights, an advanced segmentation engine, and easy-to-use marketing tools in one mobile marketing platform — giving your team the power to create amazing experiences that deepen customer relationships. Our intelligent mobile marketing platform provides the insights you need to keep users engaged and drive long-term retention and growth.
For more information check out our website and documentation.
To get started, sign up here
CleverTap Web SDK is available as an npm package or as a script to manually add to your website.
npm install clevertap-web-sdk --save
or
yarn add clevertap-web-sdk
1<script type="text/javascript"> 2 var clevertap = {event:[], profile:[], account:[], onUserLogin:[], notifications:[], privacy:[]}; 3 // replace with the CLEVERTAP_ACCOUNT_ID with the actual ACCOUNT ID value from your Dashboard -> Settings page 4clevertap.account.push({"id": "CLEVERTAP_ACCOUNT_ID"}); 5clevertap.privacy.push({optOut: false}); //set the flag to true, if the user of the device opts out of sharing their data 6clevertap.privacy.push({useIP: false}); //set the flag to true, if the user agrees to share their IP data 7 (function () { 8 var wzrk = document.createElement('script'); 9 wzrk.type = 'text/javascript'; 10 wzrk.async = true; 11 wzrk.src = 'https://d2r1yp2w7bby2u.cloudfront.net/js/clevertap.min.js'; 12 var s = document.getElementsByTagName('script')[0]; 13 s.parentNode.insertBefore(wzrk, s); 14 })(); 15</script>
Only in case you are using a package manager
1import clevertap from 'clevertap-web-sdk' 2clevertap.privacy.push({optOut: false}) // Set the flag to true, if the user of the device opts out of sharing their data 3clevertap.privacy.push({useIP: false}) // Set the flag to true, if the user agrees to share their IP data 4clevertap.init('ACCOUNT_ID', 'REGION', 'TARGET_DOMAIN') // Replace with values applicable to you. Refer below
Here:
ACCOUNT_ID
(mandatory): This value can be got from Projects page on the CleverTap Dashboard.
REGION
(optional): This will be same as the region of the CleverTap Dashboard. Possible values: (in1/us1/sg1/aps3/mec1).
TARGET_DOMAIN
(optional): domain of the proxy server.
For SPAs you need to also set the following:
1clevertap.spa = true
Events track what individual actions users perform in your app or website. Some examples of events include a user launching an app, viewing a product, listening to a song, sharing a photo, making a purchase, or favoriting an item.
1// event without properties 2clevertap.event.push("Product viewed"); 3 4// event with properties 5clevertap.event.push("Product viewed", { 6 "Product name": "Casio Chronograph Watch", 7 "Category": "Mens Accessories", 8 "Price": 59.99, 9 "Date": new Date() 10});
After you integrate our SDK, we will create a user profile for each person who launches your app or visits your website.
1// each of the below mentioned fields are optional 2// if set, these populate demographic information in the Dashboard 3clevertap.profile.push({ 4 "Site": { 5 "Name": "Jack Montana", // String 6 "Identity": 61026032, // String or number 7 "Email": "jack@gmail.com", // Email address of the user 8 "Phone": "+14155551234", // Phone (with the country code) 9 "Gender": "M", // Can be either M or F 10 "DOB": new Date(), // Date of Birth. Javascript Date object 11 "Photo": 'www.foobar.com/image.jpeg', // URL to the Image 12 13// optional fields. controls whether the user will be sent email, push etc. 14 "MSG-email": false, // Disable email notifications 15 "MSG-push": true, // Enable push notifications 16 "MSG-sms": true // Enable sms notifications 17 "MSG-whatsapp": true, // Enable whatsapp notifications 18 } 19})
If multiple users on the same device use your app, you can use the clevertap.onUserLogin
method to assign them each a unique profile to track them separately.
Here is an example showing how to add a name and an email to a user’s profile:
1// with the exception of one of Identity, Email, or FBID 2// each of the following fields is optional 3 4clevertap.onUserLogin.push({ 5 "Site": { 6 "Name": "Jack Montana", // String 7 "Identity": 61026032, // String or number 8 "Email": "jack@gmail.com", // Email address of the user 9 "Phone": "+14155551234", // Phone (with the country code) 10 "Gender": "M", // Can be either M or F 11 "DOB": new Date(), // Date of Birth. Date object 12// optional fields. controls whether the user will be sent email, push etc. 13 "MSG-email": false, // Disable email notifications 14 "MSG-push": true, // Enable push notifications 15 "MSG-sms": true, // Enable sms notifications 16 "MSG-whatsapp": true, // Enable WhatsApp notifications 17 } 18})
Web push notifications provide the ability to communicate brief, yet important alerts to your users while CleverTap’s rich segmentation and powerful infrastructure can help send time-sensitive, relevant, and personalized push messages at scale.
To know more on how to configure web push notifications for Chrome, Firefox and Safari, checkout CleverTap Web Push guide.
The offline mode allows setting CleverTap SDK to offline. The setOffline
method determines the SDK online state. By default the offline state of the sdk is set to false
.
However, once the setOffline
method is passed with true
as described below, the CleverTap SDK goes offline. All the events are recorded and queued locally, but they are not sent to the CleverTap server.
When the setOffline
method is passed with false
, as described below, the CleverTap SDK goes online, and the queued events are sent to the server immediately.
1 clevertap.setOffline(true) // sets the sdk in offline mode.Events will be queued locally and will be fired only when offline mode is set to false 2 clevertap.setOffline(false) // disables the offline mode. Events will now get fired immediately 3
This section is applicable for all browsers such as, Chrome, Firefox, and Safari. Error messages and warnings are logged to the JS console of the browser.
For verbose logging, enable verbose logging of all communication with the CleverTap servers by setting the WZRK_D
variable in sessionStorage. In the developer console of your browser type, sessionStorage['WZRK_D'] = '';
Alternatively, you can also set the log levels after calling clevertap.init()
in the following way:
1clevertap.setLogLevel(LOG_LEVEL) 2// Here Log Levels is an integer that can be any of the folowing: 3// 0: disable all logs 4// 1: display only errors 5// 2: display errors and info 6// 3: display all logs
Refer to the CleverTap Web SDK Change Log.
CleverTap Web SDK is released under the MIT license. See LICENSE for details.
No vulnerabilities found.
Reason
all changesets reviewed
Reason
no dangerous workflow patterns detected
Reason
30 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
packaging workflow detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
116 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More