For Browser
<script src="https://unpkg.com/ucc-sdk"></script>
For Node or Webpack
npm install ucc-sdk
yarn add ucc-sdk
const uccSdk = require('ucc-sdk');
import * as uccSdk from 'ucc-sdk';
Initialize the UCC-SDK
uccSdk.track.initialize({
customerId: "your_customer_id", // Customer ObjectId from MongoDB, Required
projectId: 'your_project_id', // Defaults to App Host if Not Provided
apiKey: 'live_soon_to_be_deprecated', // Optional
pageId: 'your_landing_page_id', // Optional
stage: 'dev' // Defaults to dev but Possible Values are 'dev' or 'prod'
});
Submit Page Event
For Vannilla JS
window.addEventListener('load', () => {
uccSdk.track.pageEvent();
});
For VUE JS (Vue Router)
router.afterEach(() => {
uccSdk.track.pageEvent();
});
Submit Tracking Event
uccSdk.track.submitEvent({
event: 'BUTTON_CLICKED', // event name preferrable in caps and underscore for spaces
data: { code: true, ninja: false, assassin: true }, // event data is free object that accepts any properties
user: { name: 'code assassin' }, // if user is present else defaults to browser fingerprint result
type: 'track', // defaults to track if not supplied. eligible values are: track, engagement, interaction & experience
});
Access All Methods on the Global uccSdk
uccSdk.namespace.any(); // Scroll below for namespace and associated methods
-
AssociatedAccount :
Object
-
AssociatedAccount Type.
-
NewReferralMember :
Object
-
NewReferralMember Type.
-
MemberSummary :
Object
-
MemberSummary Type.
-
PayoutSettings :
Object
-
PayoutSettings Type.
-
SocialMediaProfiles :
Object
-
SocialMediaProfiles Type.
-
ReferralProgramMember :
Object
-
ReferralProgramMember Type.
-
ReferralProgramMemberResult :
Object
-
ReferralProgramMember Type.
-
PayoutSettings :
Object
-
PayoutSettings Type.
-
SocialMediaProfiles :
Object
-
SocialMediaProfiles Type.
-
ReferralProgramMember :
Object
-
ReferralProgramMember Type.
-
ReferralProgramMemberResult :
Object
-
ReferralProgramMember Type.
-
PayoutSettings :
Object
-
PayoutSettings Type.
-
SocialMediaProfiles :
Object
-
SocialMediaProfiles Type.
-
ReferralProgramMember :
Object
-
ReferralProgramMember Type.
-
ReferralProgramMemberResult :
Object
-
ReferralProgramMember Type.
-
ReferralProgram :
Object
-
ReferralProgram Type.
-
ReferralMember :
Object
-
ReferralMember Type.
-
ReferralFriend :
Object
-
ReferralFriend Type.
-
Referral :
Object
-
Referral Type.
-
ReferralDetails :
Object
-
ReferralDetails Type.
-
Initialization :
Object
-
Initialization Type.
-
TrackingEvent :
Object
-
Tracking Event Type.
-
NewStoreCard :
Object
-
NewStoreCard Type.
-
NewStoreCardResult :
Object
-
NewStoreCard Result Type.
-
NewUserProfile :
Object
-
NewUserProfile Type.
-
NewUserProfileResult :
Object
-
NewUserProfileResult Type.
-
NewEngagement :
Object
-
NewEngagement Type.
-
SocialMediaProfiles :
Object
-
SocialMediaProfiles Type.
-
PhoneInfo :
Object
-
PhoneInfo Type.
-
BrowserInfo :
Object
-
BrowserInfo Type.
-
PersonalData :
Object
-
PersonalData Type.
-
UserProfile :
Object
-
UserProfile Type.
-
UserProfileResult :
Object
-
UserProfileResult Type.
-
NewOptIn :
Object
-
NewOptIn Type.
-
NewOptOut :
Object
-
NewOptOut Type.
Kind: global namespace
-
rfbm :
object
-
.associateFriend(referralId, userId) ⇒
Promise.<any>
-
.confirmReferral(referralId) ⇒
Promise.<any>
-
.createNewReferralMember(newReferralMember) ⇒
Promise.<MemberSummary>
-
.findReferralProgramMember(programId, application, userId) ⇒
Promise.<ReferralProgramMember>
-
.getMemberByAssociatedAccount(externalSystem, externalUserId, programId) ⇒
Promise.<ReferralProgramMemberResult>
-
.getMemberByFriend(userId, programId) ⇒
Promise.<ReferralProgramMemberResult>
-
.getMemberByUserId(programId, userId) ⇒
Promise.<ReferralProgramMemberResult>
-
.getMemberReferralStatistics(programId, memberId) ⇒
Promise.<any>
-
.getReferralDetails(referralId) ⇒
Promise.<ReferralDetails>
-
.associateFriend(referralId, userId) ⇒
Associate Friend.
Kind: static method of rfbm
Returns: Promise.<any>
- Associate Friend Result
Param | Type | Description |
---|---|---|
referralId | string |
Referral Id. |
userId | string |
User Id. |
Confirm Referral.
Kind: static method of rfbm
Returns: Promise.<any>
- Confirm Referral Result
Param | Type | Description |
---|---|---|
referralId | string |
Referral Id. |
rfbm.createNewReferralMember(newReferralMember) ⇒ Promise.<MemberSummary>
Create A New Referral Member.
Kind: static method of rfbm
Returns: Promise.<MemberSummary>
- New Referral Result
Param | Type | Description |
---|---|---|
newReferralMember | NewReferralMember |
New Referral Member. |
rfbm.findReferralProgramMember(programId, application, userId) ⇒ Promise.<ReferralProgramMember>
Find Referral Program Member.
Kind: static method of rfbm
Returns: Promise.<ReferralProgramMember>
- Get Referral Program Member Result
Param | Type | Description |
---|---|---|
programId | string |
Referral Program Id. |
application | string |
Application or External System. |
userId | string |
Referral Program User Id. |
rfbm.getMemberByAssociatedAccount(externalSystem, externalUserId, programId) ⇒ Promise.<ReferralProgramMemberResult>
Get Member By Associated Account
Kind: static method of rfbm
Returns: Promise.<ReferralProgramMemberResult>
- Get Member By Associated Account Result
Param | Type | Description |
---|---|---|
externalSystem | string |
External System. |
externalUserId | string |
External User Id. |
programId | string |
Referral Program Id. |
rfbm.getMemberByFriend(userId, programId) ⇒ Promise.<ReferralProgramMemberResult>
Get Member By Friend.
Kind: static method of rfbm
Returns: Promise.<ReferralProgramMemberResult>
- Get Member By Friend Result
Param | Type | Description |
---|---|---|
userId | string |
user objectId. |
programId | string |
Referral Program Id. |
rfbm.getMemberByUserId(programId, userId) ⇒ Promise.<ReferralProgramMemberResult>
Get Member By User Id.
Kind: static method of rfbm
Returns: Promise.<ReferralProgramMemberResult>
- Get Member By User Id Result
Param | Type | Description |
---|---|---|
programId | string |
Referral Program Id. |
userId | string |
auth0 ID. |
Get Member Referral Statistics
Kind: static method of rfbm
Returns: Promise.<any>
- Get Member Referral Statistics Result
Param | Type | Description |
---|---|---|
programId | string |
Referral Program Id. |
memberId | string |
Referral Program Member Id. |
rfbm.getReferralDetails(referralId) ⇒ Promise.<ReferralDetails>
Get Referral Details
Kind: static method of rfbm
Returns: Promise.<ReferralDetails>
- Get Referral Details Result
Param | Type | Description |
---|---|---|
referralId | string |
Referral Id. |
Kind: global namespace
-
user :
object
-
.createStoreCard(newStoreCard) ⇒
Promise.<NewStoreCardResult>
-
.create(newUserProfile) ⇒
Promise.<NewUserProfileResult>
-
.engagedWith(userId, newEngagement) ⇒
Promise.<any>
-
.getUserByAssociatedAccount(externalSystem, externalUserId) ⇒
Promise.<UserProfileResult>
-
.optIn(userId, customerId, newOptIn) ⇒
Promise.<any>
-
.optOut(userId, customerId, newOptOut) ⇒
Promise.<any>
-
.createStoreCard(newStoreCard) ⇒
user.createStoreCard(newStoreCard) ⇒ Promise.<NewStoreCardResult>
Create Store Card.
Kind: static method of user
Returns: Promise.<NewStoreCardResult>
- New Store Card Result
Param | Type | Description |
---|---|---|
newStoreCard | NewStoreCard |
New Store Card |
user.create(newUserProfile) ⇒ Promise.<NewUserProfileResult>
Create A New User Profile.
Kind: static method of user
Returns: Promise.<NewUserProfileResult>
- New User Profile Result
Param | Type | Description |
---|---|---|
newUserProfile | NewUserProfile |
New User Profile. |
Add A New Engagement.
Kind: static method of user
Returns: Promise.<any>
- New Engagement Result
Param | Type | Description |
---|---|---|
userId | string |
User ObjectID |
newEngagement | NewEngagement |
New Engagement. |
user.getUserByAssociatedAccount(externalSystem, externalUserId) ⇒ Promise.<UserProfileResult>
Get User By Associated Account
Kind: static method of user
Returns: Promise.<UserProfileResult>
- Get User By Associated Account Result
Param | Type | Description |
---|---|---|
externalSystem | string |
External System. |
externalUserId | string |
External User Id. |
Add A New Opt In.
Kind: static method of user
Returns: Promise.<any>
- New Opt In Result
Param | Type | Description |
---|---|---|
userId | string |
User ObjectID |
customerId | string |
Customer ObjectID |
newOptIn | NewOptIn |
New Opt In. |
Add A New Opt In.
Kind: static method of user
Returns: Promise.<any>
- New Opt In Result
Param | Type | Description |
---|---|---|
userId | string |
User ObjectID |
customerId | string |
Customer ObjectID |
newOptOut | NewOptOut |
New Opt In. |
Kind: global namespace
-
track :
object
-
.invokeWebhook(webhookUrl, data) ⇒
Promise.<any>
-
.pageEvent() ⇒
Promise.<any>
-
.initialize(initialization) ⇒
boolean
-
.submitEvent(trackingEvent) ⇒
Promise.<any>
-
.invokeWebhook(webhookUrl, data) ⇒
Invoke Webhook
Kind: static method of track
Returns: Promise.<any>
- Web Tracking Response
Param | Type | Description |
---|---|---|
webhookUrl | string |
webhookUrl |
data | object |
data |
Send UCC Web Page Event.
Kind: static method of track
Returns: Promise.<any>
- Web Tracking Response
Initialize UCC Web Tracking.
Kind: static method of track
Returns: boolean
- Web Tracking Init Response
Param | Type | Description |
---|---|---|
initialization | Initialization |
initialization. |
Send UCC Web Tracking Event.
Kind: static method of track
Returns: Promise.<any>
- Web Tracking Response
Param | Type | Description |
---|---|---|
trackingEvent | TrackingEvent |
trackingEvent. |
Kind: global namespace
-
payments :
object
-
.cancelDeposit(customerId, depositId) ⇒
Promise.<any>
-
.createDeposit(customerId, chainName, userId, currency, amount, tokenSymbol, events) ⇒
Promise.<any>
-
.getDeposit(customerId, depositId) ⇒
Promise.<any>
-
.getHotWallets(customerId, usage) ⇒
Promise.<any>
-
.updateDeposit(customerId, depositId, txHash) ⇒
Promise.<any>
-
.cancelDeposit(customerId, depositId) ⇒
Cancel Crypto Deposit
Kind: static method of payments
Returns: Promise.<any>
- Cancel Crypto Deposit Response
Param | Type | Description |
---|---|---|
customerId | string |
customerId |
depositId | string |
depositId |
payments.createDeposit(customerId, chainName, userId, currency, amount, tokenSymbol, events) ⇒ Promise.<any>
Create Crypto Deposit
Kind: static method of payments
Returns: Promise.<any>
- Create Crypto Deposit Response
Param | Type | Description |
---|---|---|
customerId | string |
customerId |
chainName | string |
chainName |
userId | string |
userId |
currency | string |
currency |
amount | string |
amount |
tokenSymbol | string |
tokenSymbol |
events | Array.<Object> |
events |
Get Crypto Deposit
Kind: static method of payments
Returns: Promise.<any>
- Get Crypto Deposit Response
Param | Type | Description |
---|---|---|
customerId | string |
customerId |
depositId | string |
depositId |
Get Customer Hot Wallets
Kind: static method of payments
Returns: Promise.<any>
- Get Customer Hot Wallets Response
Param | Type | Default | Description |
---|---|---|---|
customerId | string |
customerId | |
usage | string |
"ANY" |
usage |
Update Crypto Deposit
Kind: static method of payments
Returns: Promise.<any>
- Update Crypto Deposit Response
Param | Type | Description |
---|---|---|
customerId | string |
customerId |
depositId | string |
depositId |
txHash | string |
txHash |
AssociatedAccount Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
application | string |
ucc application or external system. |
userId | string |
ucc application or external system userId. |
NewReferralMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
firstName. |
lastName | string |
lastName. |
string |
email. | |
phone | string |
phone. |
country | string |
country. |
password | string |
password. |
associatedAccount | AssociatedAccount |
associatedAccount. |
referralCode | string |
referralCode. |
referralProgramId | string |
referralProgramId. |
MemberSummary Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
userProfileId | string |
userProfileId. |
auth0Id | string |
auth0Id. |
memberId | string |
memberId. |
referralLink | string |
referralLink. |
PayoutSettings Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
blockchain | string |
blockchain. |
address | string |
address. |
SocialMediaProfiles Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
username | string |
username. |
provider | string |
provider. |
ReferralProgramMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
firstName. |
lastName | string |
lastName. |
phone | string |
phone. |
country | string |
country. |
payoutSettings | Array.<PayoutSettings> |
payoutSettings. |
socialMediaProfiles | Array.<SocialMediaProfiles> |
socialMediaProfiles. |
string |
email. |
ReferralProgramMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
result | ReferralProgramMember |
referral member. |
PayoutSettings Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
blockchain | string |
blockchain. |
address | string |
address. |
SocialMediaProfiles Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
username | string |
username. |
provider | string |
provider. |
ReferralProgramMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
firstName. |
lastName | string |
lastName. |
phone | string |
phone. |
country | string |
country. |
payoutSettings | Array.<PayoutSettings> |
payoutSettings. |
socialMediaProfiles | Array.<SocialMediaProfiles> |
socialMediaProfiles. |
string |
email. |
ReferralProgramMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
result | ReferralProgramMember |
referral member. |
PayoutSettings Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
blockchain | string |
blockchain. |
address | string |
address. |
SocialMediaProfiles Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
username | string |
username. |
provider | string |
provider. |
ReferralProgramMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
firstName. |
lastName | string |
lastName. |
phone | string |
phone. |
country | string |
country. |
payoutSettings | Array.<PayoutSettings> |
payoutSettings. |
socialMediaProfiles | Array.<SocialMediaProfiles> |
socialMediaProfiles. |
string |
email. |
ReferralProgramMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
result | ReferralProgramMember |
referral member. |
ReferralProgram Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
title | string |
referral program title |
description | string |
referral program description |
ReferralMember Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
referral member firstName |
lastName | string |
referral member lastName |
ReferralFriend Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
referred friend firstName |
lastName | string |
referred friend lastName |
Referral Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
program | ReferralProgram |
referral program |
member | ReferralMember |
referral member |
friend- | ReferralFriend |
referred friend |
ReferralDetails Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
message | string |
message |
result | Referral |
result |
Initialization Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
customerId | string |
UCC Customer ID. |
projectId | string |
UCC Project/Source ID. |
apiKey | string |
UCC Customer Api Key. |
pageId | string |
UCC Landing Page Object Id. |
stage | string |
UCC Stage. |
Tracking Event Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
customerId | string |
UCC Customer ID. |
projectId | string |
UCC Project/Source ID. |
event | string |
Event Name - Find out from Project Manager. |
data | object |
Event Data - Find out from Project Manager. |
user | object |
User Data If Applicable. |
type | string |
Event Type If Applicable. Defaults to track |
NewStoreCard Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
walletProvider | string |
walletProvider. |
templateId | string |
templateId. |
customerId | string |
customerId. |
userId | string |
userId. |
NewStoreCard Result Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
passTypeIdentifier | string |
passTypeIdentifier. |
serialNumber | string |
serialNumber. |
description | string |
description. |
NewUserProfile Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
firstName. |
lastName | string |
lastName. |
string |
email. | |
phone | string |
phone. |
country | string |
country. |
password | string |
password. |
associatedAccount | AssociatedAccount |
associatedAccount. |
NewUserProfileResult Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
userProfileId | string |
userProfileId. |
auth0Id | string |
auth0Id. |
NewEngagement Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
customerId | string |
customerId. |
firstTimeOn | string |
firstTimeOn. |
SocialMediaProfiles Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
username | string |
username. |
provider | string |
provider. |
PhoneInfo Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
_id | string |
_id |
brand | string |
brand |
deviceId | string |
deviceId |
deviceLocale | string |
deviceLocale |
timeZone | string |
timeZone |
timeStamp | string |
timeStamp |
isTablet | boolean |
isTablet |
BrowserInfo Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
_id | string |
_id |
timeStamp | string |
timeStamp |
userAgent | string |
userAgent |
PersonalData Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
firstName | string |
firstName |
lastName | string |
lastName |
gender | string |
gender |
yearOfBirth | string |
yearOfBirth |
countryOfResidence | string |
countryOfResidence |
nationality | string |
nationality |
socialMedia | Array.<SocialMediaProfiles> |
socialMedia |
UserProfile Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
_id | string |
_id |
blockchainAddress | string |
blockchainAddress |
personalData | PersonalData |
personalData |
phoneInfo | Array.<PhoneInfo> |
phoneInfo |
browserInfo | Array.<BrowserInfo> |
browserInfo |
UserProfileResult Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
count | number |
count |
result | Array.<UserProfile> |
result |
NewOptIn Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
productOrService | string |
productOrService. |
optedInOn | string |
optedInOn. |
optedInIpAddress | string |
optedInIpAddress. |
optedInUserAgent | string |
optedInUserAgent. |
optedInFormUrl | string |
optedInFormUrl. |
NewOptOut Type.
Kind: global typedef Properties
Name | Type | Description |
---|---|---|
productOrService | string |
productOrService. |
optedOutOn | string |
optedOutOn. |
optedOutIpAddress | string |
optedOutIpAddress. |