Skip to content

Unity Quickstart

Setup

1. Install the Openfort SDK

There are two ways to install the SDK:

2. Set your auth providers

  1. Navigate to the auth providers page on the Openfort dashboard
  2. Click Auth providers Methods in the side bar in the users page
  3. Configure the methods you want users to be able to login with

3. Get your API keys

In the API keys section, you'll find:

  • Publishable Key: Safe to expose in client-side environment
  • Secret Key: Must be kept secure and used only server-side

To generate non-custodial wallets:

  1. Scroll to the Shield section and click Create Shield keys
  2. Store the encryption share safely when it appears (you'll only see it once)
  3. You'll receive:
    • Shield Publishable Key: Safe for client-side use
    • Shield Secret Key: Keep secure, server-side only

4. Initialize Openfort in your Unity project

Create a new script to manage the Openfort integration:

using Openfort.OpenfortSDK;
using Openfort.OpenfortSDK.Model;
 
public class OpenfortManager: MonoBehaviour {
    private OpenfortSDK openfort;
    const string PublishableKey = "YOUR_OPENFORT_PUBLISHABLE_KEY";
    const string ShieldApiKey = "YOUR_SHIELD_PUBLISHABLE_KEY";
    const string ShieldEncryptionShare = "YOUR_SHIELD_ENC_SHARE";
    
    private async void Start()
    {
        openfort = await OpenfortSDK.Init(PublishableKey, ShieldApiKey, ShieldEncryptionShare);
    }
}

5. You're ready to build!

With Openfort configured in your Unity project, you can now:

For a complete example of Openfort integration in Unity, check out our sample projects.