Skip to content

kongregate/kongregate-web

Repository files navigation

Kongregate Web API for Unity

Build and Test openupm Unity 2019.3 Unity 2018.4 Latest docs

This package provides C# bindings to the Kongregate Web API to be used in developing Unity games that will be published on the Kongregate website.

Usage and API documentation

KongregateWeb.BecameReady += () =>
{
    if (KongregateWeb.IsGuest)
    {
        Debug.Log("Player is a guest");
    }
    else
    {
        Debug.Log("Player is logged in as " + KongregateWeb.Username);
    }
};

KongregateWeb.LoggedIn += () =>
{
    Debug.Log("Player is logged in as " + KongregateWeb.Username);
};

Setup and Usage

To include kongregate-web as a Unity package, you'll need to be on Unity 2018.3 or later. kongregate-web is hosted on OpenUPM. Follow the OpenUPM getting started guide if you're not already using it, then run the following command from within your Unity project:

openupm add com.kongregate.kongregate-web

Alternate setup instructions are also available on the docs site.

Once you have added the package to your project you'll also need to setup a custom WebGL template to make the Kongregate JavaScript API available to your game.