Get started with Moderation

Note: Before you get started with Unity Moderation, make sure you meet all the requirements.

You can get started with Unity Moderation by following the instructions below.

  1. Link your project with the Unity Dashboard.
  2. Activate Unity Moderation for your project.
  3. Import the Moderation SDK.
  4. Initialize Unity services.

Activate Unity Moderation for your project

To get started with Moderation, reach out to the Moderation support team to enable it in your project.

  1. Log into the Unity Dashboard.
  2. Select the Organization for which Unity Moderation is enabled.
  3. Go to Multiplayer > Moderation.

Import the Moderation SDK

To use the Moderation SDK you will need additional Unity packages. Some are mandatory requirements while others are optional requirements:

Package nameMinimum versionType of requirementUse case
com.unity.services.moderation0.0.1-preMandatoryThe Unity Moderation package.
com.unity.services.core1.4.2MandatoryTo initialize Unity services ecosystem.
com.unity.services.authentication2.1.1 or 2.5.0-pre.3 (If you require Player Names.)MandatoryTo authenticate players in UGS services.
com.unity.nuget.newtonsoft-json3.0.2MandatoryThis package enables the other packages to handle JSON formatted responses.

For information on the Authentication package, refer to the Authentication documentation.

Additional packages

Using Vivox in your application can provide additional details on incidents. With the Vivox package, you can gather channel data and events by including the player ID and channel IDs in the report.

Package nameMinimum versionType of requirementUse case
com.unity.services.vivox16.0OptionalUsing a Vivox v16.0.0 package or higher will allow Moderation to gather channel information to enrich incident reports in the Moderation dashboard.

Initialize Unity services

The Moderation SDK exposes a singleton instance of a class that can be used to report players. To use it, initialize Unity Services and authenticate your players with Unity Authentication Service (UAS).

The following code is an example of how to authenticate a user using UAS:

using Unity.Services.Core;
using Unity.Services.Authentication;
async void Start()
{
    await UnityServices.InitializeAsync();
    await AuthenticationService.Instance.SignInAnonymouslyAsync();
    if (AuthenticationService.Instance.IsSignedIn)
    {
        // game code. 
    }
    else
    {
        Debug.Log("Player was not signed in successfully?");
    }

}