
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Fully async Node.js server module for accessing the CleverTap Server API
npm install clevertap
// require the library
const CleverTap = require('clevertap');
// init the library with your CleverTap Account Id and CleverTap Account Passcode
const clevertap = CleverTap.init(YOUR_CLEVERTAP_ACCOUNT_ID, YOUR_CLEVERTAP_ACCOUNT_PASSCODE);
// the library supports both callbacks and Promises
// upload an array of event/profile records callback style
clevertap.upload(data, {"debug":1, batchSize:50}, (res) => {console.log(res)});
// or if you prefer Promises
clevertap.upload(data, {"debug":1, batchSize:50}).then( (res) => {console.log(res)} );
// query for events
var query = {"event_name":"choseNewFavoriteFood",
"props":
[{"name":"value","operator":"contains", "value":"piz"}],
"from": 20150810,
"to": 20151025
};
//callback style
clevertap.events(query, {debug:1, batchSize:500}, (res) => {console.log(res)});
// or if you prefer Promises
clevertap.events(query, {debug:1, batchSize:500}).then( (res) => {console.log(res)} );
//query for user profiles
var query = {"event_name":"choseNewFavoriteFood",
"props":
[{"name":"value","operator":"contains", "value":"piz"}],
"from": 20150810,
"to": 20151025
}
//callback style
clevertap.profiles(query, {debug:1, batchSize:200}, (res) => {console.log(res)});
// or if you prefer Promises
clevertap.profiles(query, {debug:1, batchSize:200}).then( (res) => {console.log(res)} );
// send a push notification
var createPayload = {
"name": "green freedom",
"when": "now",
"where": {
"event_name": "App Launched",
"from": 20160101,
"to": 20160317,
},
"content":{
"title":"Hello!",
"body":"Strictly Green Lantern fans only!",
"platform_specific": {
"ios": {
"deep_link": "judepereira.com",
"sound_file": "judepereira.wav",
"category": "reactive",
"badge_count": 1,
"foo": "bar_ios"
},
"android": {
"background_image": "http://judepereira.com/a.jpg",
"default_sound": true,
"deep_link": "judepereira.com",
"foo": "bar_android"
}
}
},
"devices": [
"ios"
],
}
//callback style
clevertap.targets(clevertap.TARGET_CREATE, createPayload, {"debug":1}, (res) => {console.log(res)} );
// or if you prefer Promises
clevertap.targets(clevertap.TARGET_CREATE, createPayload, {"debug":1}).then( (res) => {console.log(res)} );
See example.js for more detailed usage.
Also please see our Server API documentation.
npm install
npm test // all tests
npm run testpush // just push specific tests
FAQs
CleverTap API library for node
The npm package clevertap receives a total of 3,115 weekly downloads. As such, clevertap popularity was classified as popular.
We found that clevertap demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.