cordova-plugin-wavecx
v0.0.2
Published
Integrates WaveCx into a Cordova project
Readme
cordova-plugin-wavecx
Integrate WaveCX into your Cordova project.
Installation
cordova plugin add cordova-plugin-wavecxUsage
// initialize WaveCx at startup
cordova.plugins.WaveCx.init({
organizationCode: 'your-org',
});
// identify user after authentication
cordova.plugins.WaveCx.updateUser({
userId: 'user-id',
userIdVerification: 'user-id-hmac-sha256', // optional, required by API if enabled in organization
userAttributes: { // optional user attributes for user segmentation
email: 'user-email',
firstName: 'user-first-name',
lastName: 'user-last-name',
custom1: 'custom-value-1',
custom2: 'custom-value-2',
custom3: 'custom-value-3',
},
});
// track screen views and custom events
cordova.plugins.WaveCx.screenView('home-screen');
cordova.plugins.WaveCx.customEvent('sign-in');
// check for content on a trigger
// e.g. to show/hide a button based on content availability
cordova.plugins.WaveCx.checkContent({
trigger: {type: 'custom-event', eventCode: 'my-event'},
callback: (hasContent) => {
if (hasContent) {
// show button
} else {
// hide button
}
},
});Platform Support
- Android
- iOS
Content Security Policy
The following domains are required to be allow by your Content Security Policy:
- connect-src https://api.wavecx.com
