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
-
On the PlayOps dashboard, open your project and go to Project > SDK Integration > SDK Credentials. Copy the App ID and the SDK Token.
-
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.
-
Commit these files:
ProjectSettings/PlayOpsSettings.jsonAssets/[Configuration]/playops-services-development.jsonAssets/[Configuration]/playops-services-production.json -
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
- In your Unity scene, create an empty GameObject (e.g.
PlayOpsBootstrap). - Attach a new MonoBehaviour script to it (e.g.
GameBootstrap.cs). - 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:
- Connect to the dashboard.
- Remove the
PlayOpsSettingsandAnalyticsSettingsarguments. If you use the MMP plugin, also removedevKeyandiosAppIdfromPlayOpsMmpSettings. - If you used
verboseLoggingoruseInvariantCulture, pass them throughPlayOpsSdkSettingsinstead.
// Beforevar playOps = new PlayOpsSDK( new PlayOpsSettings(cloudUrl: "GWS_CLOUD_URL", gameSecret: "GWS_SECRET_KEY", verboseLogging: true), new AnalyticsSettings(appId: "ANALYTICS_APP_ID"));
// Aftervar playOps = new PlayOpsSDK(new PlayOpsSdkSettings(verboseLogging: true));The old constructors still work, but they are obsolete.
What’s next
- Defining Custom Events — define your first analytics event
- Remote Configuration — deliver live config changes without a new app release