---
title: Cocos Creator | Yodo1 MAS Documentation
description: Add this line first in the script where you’ll implement MAS. To Initialize MAS, call the getInstance method and initialize it using your app's AppKey. You can find your AppKey in the MAS dashboard. T
---

[Skip to content](https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#main-content)

English

Show submenu for translations

![MAS LOGO.png\]](https://info.yodo1.com/hs-fs/hubfs/MAS%20LOGO.png?height=40&name=MAS%20LOGO.png)

Open main navigation

Close main navigation

- English
  
  Show submenu for translations
- Go to yodo1.com

 Go to yodo1.com

 How can we help?

- There are no suggestions because the search field is empty.

1. [MAS Knowledge Base](https://info.yodo1.com/migration/knowledge?hsLang=en)
2. [Documentation](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en)
3. [configure](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#configure)

# Cocos Creator | Yodo1 MAS Documentation

- <https://info.yodo1.com/?hsLang=en>
- Getting Started
- [Configuring The SDK](https://info.yodo1.com/docs/sdk/getting_started/configure/?hsLang=en)
- Cocos Creator

On this page

# Cocos Creator

### Set up the Cocos project<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#set-up-the-cocos-project>

1. Add this line first in the script where you’ll implement MAS.
   
   ```
   import Yodo1Ads from "./Yodo1Ads";
   ```
2. To Initialize MAS, call the `getInstance` method and initialize it using your app's AppKey. You can find your AppKey in the [MAS dashboard](https://mas.yodo1.com/dash/games). The second parameter is to show the default PrivacyDialog set it to true to show our built-in privacy dialog (recommended), otherwise to false.
   
   ```
   Yodo1Ads.getInstance().initializeMasSdk("YourAppkey", true);
   ```

   ![](https://static.hsstatic.net/BlogImporterAssetsUI/ex/missing-image.png)

### Configure Legal Frameworks<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#configure-legal-frameworks>

We recommend using our privacy dialog for complete and automated compliance. If you choose to not use our privacy dialog, you have to set the legal frameworks manually and ensure to set them before you initialize the SDK.

#### COPPA<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#coppa>

If the user is above 13, set COPPA to false, otherwise to true.

```
Yodo1Ads.getInstance().setCOPPA(false);
```

#### GDPR<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#gdpr>

If the user is in the European Economic Area (EEA), above 16 and gives consent, set GDPR to true, otherwise to false.

```
Yodo1Ads.getInstance().setGDPR(true);
```

#### CCPA<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#ccpa>

If the user is in California, gives consent, set CCPA to true, otherwise to false.

```
Yodo1Ads.getInstance().setCCPA(false);
```

### Configure Ad Types<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#configure-ad-types>

#### Interstitial Ads<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#interstitial-ads>

To initialize, show and listen to different ad events of the interstitials ads, use the following methods available through `Yodo1Ads.ts`.

```
// Initialize Interstitial AdsYodo1Ads.getInstance().initializeInterstitialAds();// Show Interstitial AdsYodo1Ads.getInstance().showInterstitialAds();// Listen to Interstitial Ads Eventspublic onInterstitialAdLoaded() {}public onInterstitialAdFailedToLoad() {}public onInterstitialAdOpened() {}public onInterstitialAdFailedToOpen() {}public onInterstitialAdClosed() {}
```

#### Rewarded Ads<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#rewarded-ads>

To initialize, show and listen to different ad events of the rewarded ads, use the following methods available through `Yodo1Ads.ts`.

```
// Initialize Rewarded AdsYodo1Ads.getInstance().initializeRewardAds();// Show Rewarded AdsYodo1Ads.getInstance().showRewardAds();// Listen to Rewarded Ads Eventspublic onRewardAdLoaded() {}public onRewardAdFailedToLoad() {}public onRewardAdOpened() {}public onRewardAdFailedToOpen() {}public onRewardAdClosed() {}public onRewardAdEarned() { // Reward the user here}
```

#### Banner   Ad(s)<https://info.yodo1.com/migration/knowledge/docs/sdk/getting_started/configure/cocos#bannerads>

The following code will both load and show the banner ads in your app. It exposes the banner size (`AdSize`) with it's horizontal and vertical position as parameters.

```
Yodo1Ads.getInstance().loadBannerAds("Banner", "RIGHT", "TOP");
```

To hide and show the banner ads programmatically you can use the `hideBannerAds` and `showBannerAds` methods, as needed.

```
Yodo1Ads.getInstance().hideBannerAds();Yodo1Ads.getInstance().showBannerAds();
```

To listen to different banner ads events use the following methods available through `Yodo1Ads.ts`.

```
public onBannerAdLoaded() {}public onBannerAdFailedToLoad() {}public onBannerAdOpened() {}public onBannerAdFailedToOpen() {}public onBannerAdClosed() {}
```

- [News and Updates](https://info.yodo1.com/migration/knowledge/news-and-updates?hsLang=en)
- [Documentation](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#main-content)

    - [advanced](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#advanced)
    - [installing](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#installing)
    - [legal](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#legal)
    - [configure](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#configure)
    - [troubleshooting](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#troubleshooting)
    - [support](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#support)
    - [ad\_units](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#ad_units)
    - [best\_practice](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#best_practice)
    - [payments](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#payments)
    - [account\_set\_up](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#account_set_up)
    - [user\_management](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#user_management)
    - [welcome](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#welcome)
    - [getting\_started](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#getting_started)
    - [additional](https://info.yodo1.com/migration/knowledge/documentation?hsLang=en#additional)

[![Chill listening crop-3](https://info.yodo1.com/hs-fs/hubfs/Yodo1_logo_web-2.png?width=81&height=37&name=Yodo1_logo_web-2.png "Chill listening crop-3")](http://www.yodo1.com)

MAS Knowledge Base

<https://www.facebook.com/Yodo1Games/> <https://twitter.com/yodo1games> <https://www.linkedin.com/authwall?trk=gf&trkInfo=AQFmHf-kJKnzeAAAAX_0zxNwJm9yVFmRRn1peWCuMsAZ_4z_9_7fazOzfyBIxKqw8CKSV9u3eyx3bheNvlEbiI9DYEC6AYOuIpN5MBLOqeHOaWYRsqOC18zIcwdlXAbTdb-ut5w=&originalReferer=https://www.yodo1.com/&sessionRedirect=https%3A%2F%2Fwww.linkedin.com%2Fcompany%2Fyodo1> <https://www.youtube.com/user/Yodo1Games>

Copyright © 2026, Yodo1