Unity SDK

Monetize your Unity games with BitLabs rewarded surveys.

1. Get your API Key

Sign up for a new developer account and create a new App. Copy your App Token to initiate the SDK.

2. Install the SDK

Get the latest version of our Unity package from the Unity Asset Store.

3. Use the SDK

Initiate the SDK before you use it:

// Start is called before the first frame update
void Start()
{
   BitLabs.init("YOUR_TOKEN", "YOUR_USER_ID");
}

Call the .show() function to open the Offer Wall/Router Link

BitLabs.show();

Optional: Use .appendTag() to pass additional parameters to the SDK you would like to receive in your callback

BitLabs.appendTag("userType", "new");
BitLabs.appendTag("isPremium", "false");

Optional (Android only so far): Call the .setHasSurveys() to get feedback about available surveys

// Set the name of the GameObject you would like to receive the feedback
BitLabs.setHasSurveys(gameObject.name);

// Create a receiver Method
public void OnHasSurveys (string surveyAvailable){
       Debug.Log("BitLabs Unity OnHasSurveys: " + surveyAvailable);
}

Optional (Android only so far): Call the .setOnReward() to receive client-side callbacks to reward the user. We highly recommend using server-to-server callbacks!

// Set the name of the GameObject you would like to receive the feedback
BitLabs.setOnReward(gameObject.name);

// Create a receiver Method
public void OnReward (string payout){
       Debug.Log("BitLabs Unity OnReward: " + payout);
}

4. Set up your callbacks

Setting up callbacks can be done on the dashboard. Follow the instructions and examples in our Server to Server Callback Article to properly set up callbacks.

Ready to get started?