Skip to content

Quick Start

This guide assumes you have completed the Installation steps and the SDK is imported in your project. It requires PlayOps SDK 1.9.0 or later.

Connect to the dashboard

  1. On the PlayOps dashboard, open your project and go to Project > SDK Integration > SDK Credentials. Copy the App ID and the SDK Token.

  2. In Unity, open PlayOps > Settings, paste both values, and press Get. This fills your project with what is set up on the dashboard for your game and its plugins.

    The PlayOps Settings window with App ID and SDK Token fields and a Get button
  3. Commit these files:

    ProjectSettings/PlayOpsSettings.json
    Assets/[Configuration]/playops-services-development.json
    Assets/[Configuration]/playops-services-production.json
  4. Add this to your .gitignore:

    .gitignore
    Assets/\[PlayOps\]/
    Assets/\[PlayOps\].meta

Your project has one SDK Token, shared by everyone on it. It is stored on your machine and never committed; anyone who presses Get pastes it once, and the Build Server does not need it. Whenever you change something on the dashboard, press Get again and commit the updated files.

Editor play mode and inhouse builds use your project’s development settings; store builds use production. On the Build Server this requires BuildPlugins.Unity 1.7.0 or later, which the default 1.* in Build/Pipeline/nuget.yml already covers.

If a plugin you installed is not set up on the dashboard, the build fails and names the plugin.

Scene setup

  1. In your Unity scene, create an empty GameObject (e.g. PlayOpsBootstrap).
  2. Attach a new MonoBehaviour script to it (e.g. GameBootstrap.cs).
  3. Add the initialization code in Awake() so it runs before any other game logic.

Initialize the SDK

using PlayOps;
using PlayOps.Analytics;
using PlayOps.Configurations;
using UnityEngine;
public class GameBootstrap : MonoBehaviour
{
private PlayOpsSDK playOpsSDK;
void Awake()
{
playOpsSDK = new PlayOpsSDK();
playOpsSDK.Initialize();
}
}

No credentials go into code — the SDK uses what you pulled in from the dashboard. To change a default, pass PlayOpsSdkSettings, for example new PlayOpsSDK(new PlayOpsSdkSettings(verboseLogging: true)).

Access services

Once initialized, access the SDK services through the PlayOpsSDK instance:

PlayOpsAnalytics analytics = playOpsSDK.Analytics();
PlayOpsConfigurations configurations = playOpsSDK.Configurations();
configurations.Initialize();

Upgrading from an earlier SDK version

If your code passes PlayOpsSettings or AnalyticsSettings to the PlayOpsSDK constructor:

  1. Connect to the dashboard.
  2. Remove the PlayOpsSettings and AnalyticsSettings arguments. If you use the MMP plugin, also remove devKey and iosAppId from PlayOpsMmpSettings.
  3. If you used verboseLogging or useInvariantCulture, pass them through PlayOpsSdkSettings instead.
// Before
var playOps = new PlayOpsSDK(
new PlayOpsSettings(cloudUrl: "GWS_CLOUD_URL", gameSecret: "GWS_SECRET_KEY", verboseLogging: true),
new AnalyticsSettings(appId: "ANALYTICS_APP_ID"));
// After
var playOps = new PlayOpsSDK(new PlayOpsSdkSettings(verboseLogging: true));

The old constructors still work, but they are obsolete.

What’s next