What are Kits?

Trail is built around the idea of kits; you can think of kits as modules. Each kit is built separately and as an independent service that you can choose to use or not based on your game's needs.

📘

Example

Let's say you have a card game and the monetization model is to sell card packs just like Pokemon. At the same time, you're already using Unity's Addressables to partition your game. In this case, you need to setup IAP. PaymentsKit can help you with that. However, given your game is already partitioned using Unity's Addressables, you don't need to use something like FileKit. Thus you can completely ignore that kit without any issues.

However, you need to know what each kit does to be better informed whether the features the kit provides suit your needs or not. Below is an overview of what each kit offers:

  • 🗄️ FileKit : a file streaming service that offers free hosting, versioning and compression of your game. It also helps you partition your game providing quicker load times.

  • 🗝️ AuthKit : an authentication module that will assist you in verifying the identity of a user on the Trail platform. Note this requires your own backend for optimum security.

  • 🔔️ NotificationsKit : it allows you to send notifications to your users; can be used for sharing news or maybe offers about your game.

  • 💰️ PaymentsKit : it allows you to monetize your games (whether single or multiplayer) on the Trail platform.

  • ⚙️ PerformanceKit : the optimization kit; it allows you to harness the power of WebGL combined with the Trail platform to maximize the performance of your games on the web.

  • 🐦 Pigeoneer : the first UDP based browser transport. It can integrate with different networking APIs (check the Compatibility List for the confirmed solutions)

  • 👪 PartyKit : it allows you to share information and updates between party members; share where they are in the game, etc...

Initializing the SDK

Before you use any of the kits we offer you have to first initialize the SDK. It is very simple to do:

// Identify when and where you'll make the first interaction with any of Trail's Kits.

// We recommend that you initialize in Start
private void Start()
{
    SDK.Init();
  
  SDK.OnInitialized += OnTrailInitialized;
}

private void OnTrailInitialized (Result result)
{
    if(result.IsOK()) {
     Debug.Log("Initialized Successful, now I can do what I want);
  }
  else {
     Debug.Log("Initialization failed." + result.Error());
  }
}

🚧

SDK error handling

Sometimes when you're working with the SDK, you may encounter errors. We provided the "Result" enum to help you find out what the exact error is and resolve it:

Result.Generic: This is usually an error that occurs while processing a request on the Trail Platform. We recommend you try again, if this persists, please reach out to us to investigate.

Result.SDKAlreadyInitialized: This usually happens if you try to initialize the SDK after it was already initialized.

Result.SDKHostConnectionError or Result.SDKHostDisconnected: This likely an issue with the internet connection between the game and the Trail platform. We recommend you check the status of our services here or your internet connection.

Result.SDKNotInitialized: This happens when you call any method in any of the Kits or the SDK itself prior to initializing the SDK.

Result.SDKReportGameLoadedCalledMultipleTimes: The SDK will automatically run the game after the player clicks "Play" on Trail. However, we do provide a way for you to manually start the game if you wish. This error happens if you try to start the game manually when it already running.

Updated 7 months ago

What are Kits?


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.