_CaptainUpWidget.login(userId, userName, userImage)
const key = 'country'; const value = 'USA'; _CaptainUpWidget.setUserAttributes(key, value); // This function allows you to assign custom key-value pairs to a user's profile. Parameters:
| Parameters | type | Description |
|---|---|---|
| key | string | The key name for the user attribute. |
| value | string | The value associated with the key. |
_CaptainUpWidget.setCompletedURLWithPosition(completedImageUrl, 'center') // supported positions are 'center' 'top' and 'bottom'
_CaptainUpWidget.hideCompletedChallengeOverlay(true)
| Key | Value | Description |
|---|---|---|
| completed_behavior | hidden | Hide Completed Challenges |
| Key | Value | Description |
|---|---|---|
| unsegmented_behavior | gray_out |
Show Shop Item in Grayscale.
Note: This shop item is not available for purchase. |
_CaptainUpWidget.setChallengesHeadline('Headline')
_CaptainUpWidget.setChallengesSubHeadline('Sub Headline')
_CaptainUpWidget.setLevelHeadline('Headline')
_CaptainUpWidget.setLevelSubHeadline('Sub Headline')
| Key | Value | Description |
|---|---|---|
| cta_title | Title of call to action button | |
| cta_link | Link of call to action button | |
| cta_title_[languages] | This key use for the language localization Accepted languages are: en, sp, pt, fr, gr, ru, it, de, tr, cy-sr, lt-sr, sk, th, ar-sa, ja, sw, he |
| Key | Value |
|---|---|
| cta_title | Visit |
| cta_link | https://captainup.com/ |
| cta_title_gr | Επίσκεψη |
| Key | Value | Description |
|---|---|---|
| cta_title | Title of call to action button | |
| cta_link | Link of call to action button | |
| cta_title_[languages] | This key use for the language localization Accepted languages are: en, sp, pt, fr, gr, ru, it, de, tr, cy-sr, lt-sr, sk, th, ar-sa, ja, sw, he |
| Key | Value |
|---|---|
| cta_title | Visit |
| cta_link | https://captainup.com/ |
| cta_title_gr | Επίσκεψη |
_CaptainUpWidget.pointsRequiredToReachNextLevel()
_CaptainUpWidget.userNextLevelDetails()
2. Get User Current-Level Details
_CaptainUpWidget.userCurrentLevelDetails()
_CaptainUpWidget.setFixAvatar(avatarUrl)
_CaptainUpWidget.setFeaturedItemsBackgroundImage(url)
_CaptainUpWidget.setPlayerReadOnly()
_CaptainUpWidget.setDefaultThemeSetting()
_CaptainUpWidget.setLocaleLanguage('en')
const languages = 'en, fr, sp'
_CaptainUpWidget.showLanguageSelector(languages)
| Key | Value | Description |
|---|---|---|
| header | Header of popup | |
| hide_close | true | To hide the close button and header from message notification. Value must be 'true'. |
| cta_title | Title of call to action button | |
| cta_link | link of call to action button |
_CaptainUpWidget.enableModules('challenges, shop, inbox, trophy, tournament, achievements')
_CaptainUpWidget.enableFreeToPlayTab()
_CaptainUpWidget.enableFreeToPlayPick6Tab()
_CaptainUpWidget.enableFreeToPlayWheelTab()
_CaptainUpWidget.enableFreeToPlayReelTab()
_CaptainUpWidget.enableCanSmashCasualGame()
_CaptainUpWidget.enableEmojiBlastCasualGame()
_CaptainUpWidget.enableTennisCasualGame()
_CaptainUpWidget.enableGoal()
_CaptainUpWidget.setCustomBanner(name, content, redirectUrl, displayOrder); Parameters:
| Parameter | Type | Description |
|---|---|---|
| name | string | The unique name of the banner. |
| content | string | The text content of the banner. |
| redirectUrl | string (optional) | The URL where users will be redirected when clicking the banner. |
| displayOrder | number (optional) | The order in which banners should be displayed. |
_CaptainUpWidget.getCustomBanners(); // Returns an array of custom banners
Notes:
1. If there are no banners, an empty array is returned.
2. Each banner object contains `name`, `content`, `redirectUrl`, and `displayOrder`.
3. The banners are retrieved in their sorted display order.
_CaptainUpWidget.setCustomBannerAutoPlay(autoplay, duration) Parameters:
| Parameter | Type |
|---|---|
| autoplay | boolean |
| duration(milliseconds) | number |
_CaptainUpWidget.setCustomTab(customTabName, customTabURL, customTabLinkIconSvgCode, customTabAllowFullscreen, customTabTabSize, customTabLang)
_CaptainUpWidget.setCustomTab2(customTab2Name, customTab2URL, customTab2LinkIconSvgCode, customTab2AllowFullscreen, customTab2TabSize, customTab2Lang)
_CaptainUpWidget.setCustomTab3(customTab3Name, customTab3URL, customTab3LinkIconSvgCode, customTab3AllowFullscreen, customTab3TabSize, customTab3Lang)
_CaptainUpWidget.setCustomTab4(customTab4Name, customTab4URL, customTab4LinkIconSvgCode, customTab4AllowFullscreen, customTab4TabSize, customTab4Lang)
_CaptainUpWidget.setCustomTab5(customTab5Name, customTab5URL, customTab5LinkIconSvgCode, customTab5AllowFullscreen, customTab5TabSize, customTab5Lang)
const module = 'custom1'; const sandbox = 'allow-scripts allow-downloads'; // Sandbox attribute settings _CaptainUpWidget.setCustomTabSandbox(module, sandbox); // Assigns specific iframe sandbox attributes to the given module.
| Parameters | type | Description |
|---|---|---|
| module | string |
Specifies the target module for applying the sandbox attributes.
Accepted values include: custom1, custom2, custom3, custom4, custom5, free2Play, free2Play_wheel, free2Play_reel, can_smash_casual_game, emoji_blast_game, tennis_casual_game |
| sandbox | string | Defines the sandbox restrictions for the iframe. This value determines which permissions are granted to content within the module. Common values include allow-scripts, allow-downloads, and other sandbox directives. |
_CaptainUpWidget.setCustomHtmlTab(customTabHtmlName, customTabHtml, customTabHtmlIconSvgCode)
_CaptainUpWidget.setCustomHtmlTab2(customTabHtml2Name, customTabHtml2, customTabHtml2IconSvgCode)
_CaptainUpWidget.setCustomHtmlTab3(customTabHtml3Name, customTabHtml3, customTabHtml3IconSvgCode)
_CaptainUpWidget.setCustomHtmlTab4(customTabHtml4Name, customTabHtml4, customTabHtml4IconSvgCode)
_CaptainUpWidget.setCustomHtmlTab5(customTabHtml5Name, customTabHtml5, customTabHtml5IconSvgCode)
_CaptainUpWidget.setInfoContent('inf content for info icon popup in profile section')
_CaptainUpWidget.showInfoOnFirstVisit()
| Key | Value | Description | Is Locale available |
|---|---|---|---|
| category | Category of item | Yes | |
| ribbon_text | Ribbon text | Yes | |
| ribbon_color | Ribbon background color | ||
| ribbon_text_color | Ribbon text color | ||
| overlay_image | Image path for make it overlay from main image |
Note: for localization please add _{langue code} after the key. e.g. cta_title_fr
| Key | Value | Description | Is Locale available |
|---|---|---|---|
| sub_level_count | number | Number of sub level | No |
| sub_level_[level number] | name | points | img_URL | name: name of sub-levels. points: points required to reach that sub-level. img_URL: image link for the sub-level. |
No |
| Key | Value |
|---|---|
| sub_level_count | 5 |
| sub_level_1 | Title 1 | 500 | https://i.ibb.co/xMfhkFs/image-1.png |
| sub_level_2 | Title 2 | 600 | https://i.ibb.co/xMfhkFs/image-2.png |
| sub_level_3 | Title 3 | 700 | https://i.ibb.co/xMfhkFs/image-3.png |
| sub_level_4 | Title 4 | 800 | https://i.ibb.co/xMfhkFs/image-4.png |
| sub_level_5 | Title 5 | 900 | https://i.ibb.co/xMfhkFs/image-5.png |
_CaptainUpWidget.setHideSubTierText()
_CaptainUpWidget.useLevelAvatarForProfilePic()
| Key | Value | Description | Is Locale available |
|---|---|---|---|
| avatar_url | URL | Image link for the avatar | No |
_CaptainUpWidget.useTierAvatarForProfilePic()
| Key | Value | Description | Is Locale available |
|---|---|---|---|
| avatar_url | URL | Image link for the avatar | No |
_CaptainUpWidget.useLevelUsername()
| Key | Value | Description | Is Locale available |
|---|---|---|---|
| username | Username | Username for the Profile | No |
_CaptainUpWidget.useSubTitleOfLevel()
| Key | Value | Description | Is Locale available |
|---|---|---|---|
| sub_title | Sub Title | By default it will be like "3000 Points" if no data set | Yes |
_CaptainUpWidget.hideLevelPoints()
_CaptainUpWidget.hideOutOfStockShopItems()
_CaptainUpWidget.hideUsername()
_CaptainUpWidget.sortByPriceLowToHigh()
_CaptainUpWidget.setPlayerCountry("USA")
_CaptainUpWidget.hideMenubarLabels()
_CaptainUpWidget.hideScrollInstructionsInShopPage()
_CaptainUpWidget.customHtmlDisableAutoConvertToLink()
_CaptainUpWidget.hideProfilePicture()
_CaptainUpWidget.enableBadgeProgressNotification()
_CaptainUpWidget.disableNotifications('achieve, level_up')
_CaptainUpWidget.setNotificationDuration(1000)
_CaptainUpWidget.setNotificationPosition('top-right')
_CaptainUpWidget.hideProfileSection()
_CaptainUpWidget.disableShopDetailsSection()
_CaptainUpWidget.disableChallengesDetailsSection()
_CaptainUpWidget.hideMenu()
_CaptainUpWidget.displayRewardDetailsOnChallenges()
_CaptainUpWidget.sortBadgesByProgressHighToLow()
| Key | Value | Description |
|---|---|---|
| category_weight | number | Numbers are sorted in ascending order |
| Key | Value |
|---|---|
| category_weight | 1 |
| Key | Value | Description |
|---|---|---|
| visibility | string | To hide a specific currency from the widget. |
| visibility_condition | string | To hide a specific currency for a particular country in the widget. |
| Key | Value | Description | |
|---|---|---|---|
| visibility | hidden | ||
| visibility_condition | user.cpt_country=GA,FR,CA |
user -> user attribute cpt_country -> The key name of the user attribute that stores the user's country. GA,FR,CA -> The values for which the currency will be hidden in these countries |
_CaptainUpWidget.disableNotificationForRepeatableBadges()
_CaptainUpWidget.setChallengesCardView()
const enable = true const url = '' // url is optional parameter and use for set the streak progressbar image _CaptainUpWidget.enableStreakProgressBarForModular(enable, url)
_CaptainUpWidget.setProfileTabDisplayOrder('challenges, shop, banners, free-game')
const theme = {
...
fonts: {
headerFontName: 'Roboto',
contentFontName: 'Roboto Condensed',
otherFontName: 'Roboto Condensed'
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
primary: '#69a5ff',
secondary: '#4f2a5f',
bodyBackground: '#272d33',
cardBackground: '#171b1f',
cardMenuBackground: '#363a42',
menuBackground: '#363a42',
progressBarBackground: 'gray',
progressBarFill: '#69a5ff',
footerBackground: '#363a42',
button: '#69a5ff',
buttonHover: '#4f2a5f',
buttonInactive: '#4f2a5f',
buttonText: '#000000',
buttonHoverText: '#ffffff',
buttonInactiveText: '#ffffff',
headingText: '#69a5ff',
contentText: '#ffffff',
footerText: '#ffffff',
currencyText: '#69a5ff',
selectedMenuText: '#69a5ff',
selectedItemBackground: '#919191'
informationPopupBackground: '#ffffff'
backdropColor: '#000000',
backdropOpacity: 0.4,
notificationPopupHeaderBackground: '#363a42',
notificationPopupHeaderText: '#FFFFFF',
notificationPopupBodyBackground: '#272d33',
notificationPopupBodyText: '#FFFFFF',
notificationPopupTitleText: '#69a5ff',
notificationPopupCloseIcon: '#69a5ff',
notificationPopupButtonBackground: '#69a5ff',
notificationPopupButtonText: '#ffffff',
notificationPopupButtonHoverBackground: '#4f2a5f',
notificationPopupButtonHoverText: '#ffffff',
currentLevelShadow: '',
sidebarBorderColor: '',
sidebarBorderWidth: '',
buttonBorderRadius: '50px',
scrollBar: '#69a5ff',
scrollBarBackground:'#808080',
mainMenuText: '',
errorHeadingText: '#FF0000',
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
embed3 : {
secondaryButtons: '#000000',
secondaryButtonsText: '#00ffd1',
secondaryButtonsHover: '#4e13d3'
secondaryButtonsHoverText: '#ffffff'
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
embed : {
conditionBackground: '#ffffff',
conditionText: '#000000',
conditionBorder: '#f8ad1b',
completedConditionBackground: '#669900',
completedConditionText: '#ffffff',
completedConditionBorder: '#f8ad1b',
cardBorder: '#cacaca'
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
sideReveal : {
accentButton: '#282828',
accentButtonText: '#000000',
accentButtonHover: '#f8ad1b',
accentButtonHoverText: '#669900',
accentButtonInactive: '#ffffff',
accentButtonInactiveText: '#f8ad1b',
challengesCardBackground: '#ffffff',
challengesCardContentText: '#000000',
menuText: '000000',
mainHeadingText: '#cacaca',
secondaryButton: '#ffffff',
secondaryButtonText:'#000000',
secondaryButtonHover:'#000000',
secondaryButtonHoverText:'#ffffff',
secondaryButtonInactive:'232323',
secondaryButtonInactiveText:'528284',
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
OPAP: {
svgIconColor:'#16BA3A',
boxShadowColor: '#0000001F',
categoryButtonBackground: '#9499a880',
categoryButtonText: '#ffffff',
categoryButtonBorder: '#696F81',
categoryActiveButtonBackground: '#ffffff',
categoryActiveButtonText: '#000000',
levelCardBackground:"#1D1AB5",
levelBenefitsBackground:"#ECEDF0",
levelBenefitsText:"#000000",
activeButtonBorder: "#FFA800",
borderColor: "#3B3E49",
completedProgressFill: "#16BA3A",
customButtonBackground : "#ffffff",
customButtonText: "#000000",
customButtonHover: "#000000",
customButtonHoverText: "#ffffff",
modalButton: "#16BA3A",
modalButtonText: "#000000",
modalButtonHover: "#3EA6FF",
modalButtonHoverText: "#000000",
modalContentText: "#000000"
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
inlineWidget : {
...
_cpt_profile_widget: {
profileBackground: '#F1F1F1',
profileHeadingText: '#373737',
profileContentText: '#373737',
profileCurrencyText: '#373737',
profileProgressBarBackground: '#D6D6D6',
profileProgressBarFill: '#FDB640',
profileBorderColor: '#E4E3E3'
}
...
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
inlineWidget : {
...
_cpt_level_widget: {
levelBackground: '#F1F1F1',
levelProgressBarBackground: '#D6D6D6',
levelProgressBarFill: '#FDB640',
levelBorderColor: '#E4E3E3',
levelHeadingText: '#373737'
}
...
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
inlineWidget : {
...
_cpt_challenges_widget: {
challengesBackground: '#F1F1F1',
challengeCardBackground: '#FFFFFF',
challengesHeadingText: '#373737',
challengesContentText: '#373737A4',
challengesProgressBarBackground: '#D6D6D6',
challengesProgressBarFill: '#FDB640',
challengesCurrency: '#373737',
challengesCardBorder: '#E4E3E3',
challengesButton: #000000,
challengesButtonText: #ffffff,
challengesButtonHover: #DCDBDB;
challengesButtonHoverText: #000000
challengesDetailsBackdrop: #000000
challengesDetailsBackdropOpacity: '0.5'
challengesScrollbarTrack: #f1f1f1
challengesScrollbarThumb: #c1c1c1
}
...
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
inlineWidget : {
...
_cpt_shop_widget: {
shopBackground: '#F1F1F1',
shopCardBackground: '#FFFFFF',
shopHeadingText: '#373737',
shopContentText: '#373737A4',
shopCurrency: '#373737',
shopCardBorder: '#E4E3E3',
shopButton: '#000000',
shopButtonText: '#ffffff',
shopButtonHover: '#000000',
shopButtonHoverText: '#000000',
shopButtonDisable: '#DCD8D8',
shopButtonDisableText: '#261E1E',
modalBackdropColor: '#000000',
modalBackdropOpacity: '0.5'
}
...
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
inlineWidget : {
...
_cpt_inbox_widget: {
inboxBackground: '#F1F1F1',
inboxHeadingText: '#373737',
inboxText: '#373737A4',
inboxBadge: '#000000',
inboxBadgeText: '#ffffff',
inboxBorderColor: '#E4E3E3'
}
...
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
colors: {
...
inlineWidget : {
...
_cpt_tournament_widget: {
tournamentBackground: #F1F1F1,
tournamentHeadingText: #373737,
tournamentContentText: #373737A4,
tournamentBoardBackground: #FFFFFF,
tournamentBoardText: #373737A4,
tournamentActiveText: #29AA00,
tournamentUpcomingText: #06819B,
tournamentInactiveText: #DC3545,
tournamentBorderColor: #E4E3E3,
tournamentButton: #000000,
tournamentButtonText: #FFFFFF,
tournamentButtonHover: #DCDBDB,
tournamentButtonHoverText: #000000,
tournamentButtonDisable: #EEEEEE,
tournamentButtonDisableText: #919393,
tournamentTableTab: #DCDBDB,
tournamentFirstRank: #FFEFB3,
tournamentSecondRank: #F1F1F1,
tournamentThirdRank: #ECD8D8,
tournamentScrollbar: #ffa500,
tournamentScrollbarBackground: #808080
}
...
}
...
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
widgetTopSpacing: {
widgetTopSpacingDesktop: "0px",
widgetTopSpacingMobile: "0px"
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
gradientBackgroundColors: {
profileBackgroundGradient: 'radial-gradient(circle, rgb(110 18 129) 0%, rgb(17 5 65) 90%)',
challengesBackgroundGradient: 'radial-gradient(circle, rgb(110 18 129) 0%, rgb(17 5 65) 90%)'
progressBarGradient: 'linear-gradient(to right, rgb(244 190 255) 0%, rgb(122 98 255) 90% 100%)'
challengesProgressBarGradient: 'linear-gradient(to right, #e5405e 0%, #ffdb3a 45%, #3fffa2 100%)'
challengesCompletedProgressBarGradient: 'linear-gradient(to right, #e5405e 0%, #ffdb3a 45%, #3fffa2 100%)'
buttonBackgroundGradient: 'linear-gradient(180deg, #7BDBDF 0%, #028F91 100%)',
buttonBackgroundGradientHover: 'linear-gradient( #93e6e9 0%, #93e6e9 100%)',
buttonBackgroundGradientDisabled: 'linear-gradient(#444444 0%, #444444 100%)',
shopHoverBackgroundGradient: 'linear-gradient(135deg,#1a0533,#33083f 36%,#53034b 53%,#750052 65%,#990054 75%,#b80050 83%,#d10046 92%,#eb1e36)',
scrollBarGradient: 'linear-gradient(0deg, rgb(234, 102, 24), rgb(154, 1, 182))',
midViewCurrencyGradient: 'linear-gradient(180deg, #823d9b -4%, #130f21 45%, #7146ab 50%)'
cardBackgroundGradient: 'linear-gradient(295deg, rgba(0,0,0,1) 58%, rgba(0,132,108,1) 100%)'
borderGradientColor: 'linear-gradient(to bottom, transparent, #808080)'
borderGradientColors: 'linear-gradient(117.86deg, rgba(124, 119, 119, 0.196) 23.38%, rgba(28, 32, 38, 0.064) 100%)'
cardGradientColors: 'linear-gradient(118.26deg, rgba(143, 146, 149, 0.16) 23.84%, rgba(73, 80, 87, 0.16) 100.29%)'
}
...
}
_CaptainUpWidget.setTheme(theme)
const theme = {
...
bodyBackgroundImage: {
desktop: '',
mobile: '',
midView:'',
midViewProfile:'',
}
...
}
_CaptainUpWidget.setTheme(theme)
_CaptainUpWidget.disableLevelsGrayscale(true)
const theme = {
...
fonts: {
headerLetterSpacing: '2px',
contentLetterSpacing: '2px'
}
...
}
_CaptainUpWidget.setTheme(theme)
const module = 'profile'; const iconURL = ''; // add you svg link _CaptainUpWidget.setMenuIcon(module, iconURL); // This function allows you to set custom header icons. Parameters:
| Parameters | type | Description |
|---|---|---|
| module | string | The module name for set the individual module icon. The accepted values was: profile, challenges, shop, inbox, tournament, trophy |
| iconURL | string | The iconURL associated with the module. Upload your svg icon on server/public folder and set that .svg file |
const theme = {
...
layout: 'popup'
...
}
_CaptainUpWidget.setTheme(theme)
CaptainUpWidget.setLevelsNoOfLines(titleNoOfLines, descriptionNoOfLines);
_CaptainUpWidget.setChallengesNoOfLines(titleNoOfLines, descriptionNoOfLines);
_CaptainUpWidget.setShopNoOfLines(titleNoOfLines, descriptionNoOfLines);
Note: Passed argument must be the number. _CaptainUpWidget.makeNextNLevelVisible(3)
_CaptainUpWidget.setChallengesLayout('carousel')
_CaptainUpWidget.setRewardLayout('carousel')
_CaptainUpWidget.hideCloseIconOnMobile()
_CaptainUpWidget.hideCloseIconOnDesktop()
_CaptainUpWidget.setPopupSizeMobile('large')
_CaptainUpWidget.setPopupSizeDesktop('large')
_CaptainUpWidget.setPopupSize('large') // set for mobile and desktop
_CaptainUpWidget.setPopupSize('normal') // set for mobile and desktop
_CaptainUpWidget.setLevelListingStrategy('current_level')
_CaptainUpWidget.setLevelListingStrategy('first_level')
_CaptainUpWidget.hideRewardButton()
_CaptainUpWidget.hideDotsInLevel(hideOnDesktop, hideOnMobile)
_CaptainUpWidget.hideDotsInChallenges(hideOnDesktop, hideOnMobile)
_CaptainUpWidget.disableLoopForLevels()
_CaptainUpWidget.setDisplayBadgeCompletedCount()
_CaptainUpWidget.setRelativePoints()
_CaptainUpWidget.displayTiers()
_CaptainUpWidget.enableCategoryIcon() allCategoryIconURL = "" // This URL is use for the "All" titled category for the badges and assets shop items _CaptainUpWidget.setAllCategoryIconURL(allCategoryIconURL)
| Key | Value | Description |
|---|---|---|
| category_icon_url | URL | Image link for the category icon |
_CaptainUpWidget.enableLevelBulletPoints()
| Key | Value | Description | Is Locale available |
|---|---|---|---|
| bullet_title_[point number] | string | Add the description | No |
| bullet_title_[point number]_[language] | string |
Add the language code Accepted values are en, sp, pt, fr, gr, ru, it, de, tr, cy-sr, lt-sr, sk, th, ar-sa, ja, sw, he |
No |
| Key | Value |
|---|---|
| bullet_title_1 | Free Spins every month |
| bullet_title_2 | Birthday Bonus to celebrate your special day |
| bullet_title_3 | Access to special tournaments and missions |
| bullet_title_1_fr | Tours gratuits chaque mois |
const module = 'profile';
const position = 'top';
const html = 'HTML code' // put your html code here as a string
_CaptainUpWidget.setPopup2CustomHtml(module, position, html);
_CaptainUpWidget.enableMidView()
_CaptainUpWidget.setWidgetBorderRadius('20px')
_CaptainUpWidget.setSideBarHidden()
_CaptainUpWidget.hideProgressBarAtSideBar()
_CaptainUpWidget.hideMaximizedSideBar()
_CaptainUpWidget.setBorderSideBar(true)
_CaptainUpWidget.showSquareSidebar()
_CaptainUpWidget.openPopupByDefaultOnDesktop()
_CaptainUpWidget.openPopupByDefaultOnMobile()
_CaptainUpWidget.disableWebsiteScroll()
_CaptainUpWidget.setNotificationsShowOnFocus()
_CaptainUpWidget.closeWidgetOnBackdropClick(false)
_CaptainUpWidget.open()
_CaptainUpWidget.open('challenges')
_CaptainUpWidget.open('shop')
_CaptainUpWidget.open('inbox')
_CaptainUpWidget.open('tournament')
_CaptainUpWidget.open('trophy')
_CaptainUpWidget.logout() // logout with reload _CaptainUpWidget.logout(false) // logout without reload
| Key | Value | Description |
|---|---|---|
| identifier | string | Set the identifier to display the corresponding badges. |
| Key | Value |
|---|---|
| identifier | real_jackpot |
Put below code in the body tag
<div class="_captain_up_badges" identifier='real_jackpot' items-to-show='2'></div> <div class="_captain_up_badges" identifier='exclusive' items-to-show='2'></div>
identifier:Set the value to match the identifier name under badges->Custom Data. items-to-show:Specify the number of items to display on the slider.
| Key | Description |
|---|---|
| post_purchase_message | Display message on the asset successfully purchase |
| post_purchase_message_[languages] | This key use for the language localization Accepted languages are: en, sp, pt, fr, gr, ru, it, de, tr, cy_sr, lt_sr, sk, th, ar_sa, ja, sw, he |
| Key | Value |
|---|---|
| post_purchase_message |
You will receive your tickets to your email within 24 hours. Please contact {asset_name} for any inquiries. Note: If you want to show the asset name into the string then add the {asset_name} into the string. |
| post_purchase_message_gr | Θα λάβετε τα εισιτήριά σας στο email σας εντός 24 ωρών. Επικοινωνήστε με το X για οποιαδήποτε απορία. |
| Key | Description |
|---|---|
| buy_button_label | Label for the buy button on shop section |
| buy_button_label_[languages] | This key use for the language localization Accepted languages are: en, sp, pt, fr, gr, ru, it, de, tr, cy-sr, lt-sr, sk, th, ar-sa, ja, sw, he |
| Key | Value |
|---|---|
| buy_button_label | Vote |
| buy_button_label_gr | Ψήφος |
Note:
1. Replace only predefined words.
const langOverWriteEN = {
challenges: 'Missions',
shop: 'Rewards',
trophies: 'Prizes',
areYouSure: 'Are you sure you want to redeem your points for {name} ? You will not be able to retrieve your points after exchanging them.',
bonusAlreadyAssigned: 'Player can have only one active bonus. In order to receive a new bonus, your active bonus must be completed or closed.'
}
const langOverWriteGR = {
trophies: 'Έπαθλα',
youHave: 'Έχεις ',
bonusAlreadyAssigned: 'Οι εγγεγραμμένοι παίκτες μπορούν να έχουν μόνο ένα ενεργό μπόνους κάθε φορά. Για την απόκτηση κάποιου άλλου μπόνους, θα πρέπει αρχικά το ενεργό μπόνους να έχει εκπληρωθεί ή να έχει κλείσει.'
}
_CaptainUpWidget.setLanguageOverwrite('en', langOverWriteEN)
_CaptainUpWidget.setLanguageOverwrite('gr', langOverWriteGR)
Note:
1. Please return null if you need to ignore that notification.
_CaptainUpWidget.beforeDisplayNotification((type, language, entity, text) => {
// add the conditions as per requirement
if(type == 'achieve' && language == 'el-gr') {
return 'Μόλις κέρδισες πόντους & PS Coins στο PS Rewards'; // return the modified notification text
}
return text; // for other notifications show as accepted please put this return value
})| Parameter | Data Type | Possible Values |
|---|---|---|
| type | string | achieve, level_up, currencies, tier_up, tier_down, tier_kept |
| language | string | 'en-us', 'fr-fr', 'de-de', 'el-gr', etc. |
| entity | Object | {
active: true,
name: 'XXX',
...badgeOtherDetails
} |
| text | string | You achieved X badge |
_CaptainUpWidget.shouldAutoCloseNotification((type, language, entity, shouldAutoclose) => {
// add the conditions as per requirement
if(type == 'achieve') {
// true = notification auto close true
// false = notification auto close false (need to close the notification)
return false; // return the true or false
}
return shouldAutoclose; // for other notifications show as accepted please put this return value
})| Parameter | Data Type | Possible Values |
|---|---|---|
| type | string | achieve, level_up, currencies, tier_up, tier_down, tier_kept |
| language | string | 'en-us', 'fr-fr', 'de-de', 'el-gr', etc. |
| entity | Object | {
active: true,
name: 'XXX',
...badgeOtherDetails
} |
| shouldAutoclose | boolean | true or false |
Notes:
1. Set dynamic options/data to be pass while purchasing shop item
2. Object Keys must be string
const dynamic_options_for_reward = {
...
"name": "override value",
...
}
_CaptainUpWidget.setDynamicOptionsForRewards(dynamic_options_for_reward)_CaptainUpWidget.subscribe((type, entity) => {
// add the conditions as per requirement
})| Parameter | Data Type | Possible Values |
|---|---|---|
| type | string | currencies, inbox, badges, activities, levels, assets, tournaments |
| entity | any | {
active: true,
name: 'XXX',
...otherDetails
}
or
const entity = {
active: true,
name: 'XXX',
...otherDetails
}
[ entity, entity ]
|
_CaptainUpWidget.onUserInteraction((action, data) => {
// add the conditions as per requirement
})| Parameter | Data Type | Possible Values |
|---|---|---|
| action | string | open_widget, close_widget, visit_profile_page, visit_reward_page, visit_challenges_page, visit_shop_page, visit_tournament_page, visit_trophy_page, visit_inbox_page, visit_custom_link_tab, visit_custom_html_tab, visit_custom_html_tab_2, visit_free2play_tab, visit_single_challenge, visit_single_shop_item, visit_single_tournament, read_inbox_item, click_on_category_of_challenges, click_on_category_of_shop, click_on_category_of_tournament, claim_reward_manually, click_on_challenges_CTA, click_on_messages_CTA, acquire_shop_item, join_tournament, shop_item_click_buy, shop_item_click_confirm, shop_item_click_cancel |
| data | object | const data = {
active: true,
name: 'XXX',
...otherDetails
}
or
const data = {}
|
_CaptainUpWidget.getUser((userInfo) => {
// logged in user info
})
_CaptainUpWidget.getLevels((levels) => {
// all the level info
})
const allBadges = _CaptainUpWidget.getAllBadges()
const allAssets = _CaptainUpWidget.getAllAssets()
const allLevels = _CaptainUpWidget.getAllLevels()
const allTiers = _CaptainUpWidget.getAllTiers()
_CaptainUpWidget.afterLogin(() => {
// Add your code here to execute after a successful login.
})
const userData = _CaptainUpWidget.getUserData()
window._CaptainUpWidget.onLanguageSelection((language) => {
// to get the widget language
})
<div id="_captain_up"></div>
<script src="https://captainup.com/assets/sdk.js"></script>
<script src="https://captainup.com/assets/widget.js"></script>